Bash Shell Programming HowTos

Tutorials, howtos and programming tips about GNU Bourne-Again SHell (BASH) for Apple OS X, Linux, *BSD and Unix like operating systems. ( rss feed )

I am a new Unix / Linux user. I am using whatis command to find man pages. But, I noticed that some man pages have a common names. For example, when I run whatis printf:

Outputs:

printf (1) - format and print data
printf (1p) - write formatted output
printf (3) - formatted output conversion
printf (3p) - print formatted output
printf [builtins] (1) - bash built-in commands, see bash(1)

How do I access overlapping man pages and what is the meaning of (1), (1p), (3), and so on?

{ 1 comment }

I am a new Linux user. I use scp to upload files to net-storage provided CDN company. I do not want to overwrite the existing files. How can I prevent overwriting of files when using scp command under Linux, Mac OS X or Unix like operating systems?

{ 2 comments }

I need to clean up my backups stored on the nas server. I need to free up the disk space. How do I find out all hidden dot directories such as /nas01/backups/home/user/.gnome/, /nas01/backups/home/user/.gnome/ and so on and delete then in a single pass using Linux or Unix command line option? Please note that I do not want to delete nested hidden directories such as /nas01/backups/home/user/data/.xml, /nas01/backups/home/user/foo/bar/.level/.levle2/ and so on.

{ 4 comments }

I would like to see the Time-to-live (TTL) value for a ‘AAAA’ and A record for domains. How do I see Time-to-live (TTL) for a DNS record under Unix or Linux operating systems using command line options?

{ 3 comments }

I am a new Linux user. I have text files with lots of empty lines. How do I delete all empty lines under Linux or Unix operating systems?

{ 3 comments }

How do I match dot files under Unix / Linux using bash shell? Why .* considered as harmful when matching dot files under bash shell?

{ 5 comments }

I am a new Unix user. How do I rm (remove) all files in a directory called personal-files under Unix like operating systems?

{ 3 comments }