≡ Menu

Unix Tagged Q & A

Question and answer for users of Unix-like operating systems. Topic includes – Unix commands, servers, security, networking, shell programming, troubleshooting and much more ( rss feed ).

How do I check in GNU/Bash if a shell is running in interactive mode or not while writing shell scripts?
[click to continue…]


The following question was asked in the Unix networking exam:

How do you speed up ping and traceroute command responses under Unix or Linux operating systems?

[click to continue…]

I'm using Debian Linux as my development workstation. I would like to search a directory called ~/projects/ recursively for "foo" word only for *.txt files. How do I search all text files in ~/projects/ for "foo" word using grep command?
[click to continue…]

Linux dd Command Show Progress Copy Bar With Status

I'm using dd command for block level copy and just found out that there's no built in way to check the progress. How do I use the Linux or Unix dd command while coping /dev/sda to /deb/sdb and display a progress bar when data goes through a pipe?
[click to continue…]

I would like to search and find all files which contain a word called "main()" for all directories located in $HOME/project/school. How do I use the grep command to find text including all subdirs under Unix or Linux operating systems?
[click to continue…]

HowTo: Revoke OpenSSH Keys and Disable User Access

Many users are using ssh to log into a remote machine and append the indicated identity file to machine's ~/.ssh/authorized_keys file. I recently moved one of my server, and I would like to revoke openssh keys and disable user access under Linux operating systems. How do I revoke OpenSSH keys under Unix or Linux operating systems?
[click to continue…]

Linux / Unix: sed Command Print Only Matching Lines

I see many examples and man pages on how to do operations like search-and-replace using sed. But, I want to match a given string or a regular pattern expression and display on the screen. How do I print lines with matching pattern using sed command only under Unix like operating systems?
[click to continue…]