Some useful tips while working under GNU Bash – part 2

terminal-icon-512x512[1] Efficient use of command line history using !! and !
Double exclamation i.e, ‘!!’ represents the last run command on the bash. Here is an example :
$ uname -r
3.2.0-55-generic
$ !!
uname -r
3.2.0-55-generic

Now, let’s come to single exclamation i.e, ‘!’ . Unlike ‘!!’, through single exclamation ‘!’, we can access any previously run command that exists in
Continue reading

Advertisements

Some useful tips while working under GNU Bash – part 1

ImageGiven below are some typical commands used in bash environment under a variety of circumstances. Check out the listing and I am sure everyone who reads this will be benefited from at least one of the following…
[1] du utility command
You can use the du utility to estimate file space usage. For example,
user@GNULinux:~$ du -sh /home/user/photorec.ses
    40K    /home/user/photorec.ses
    
-s for summarizing and -h for making the displayed size human readable. Look at another example,

user@GNULinux:~$ cd /home/
    user@GNULinux:/home$ du -sh *
    2.1G    user

[2] Freeze a process temporarily using ID
Continue reading