- 3,124 hits
Place for playing with commands…
ODOC: bala@bala:~ /home$ du && python sample.py && pwd
Use && to arrange for subsequent commands to run, only if earlier
ones succeeded. We can use it for some conditions.
In above command if python file shows any error means pwd command
will not execute.
ODOC: bala@bala:~ /home$ ffmpeg -i audio.wav -acodec libmp3lame audio.mp3
It is used to convert wav to mp3 format. for that we have to install ffmpeg by
For Debian based OS:
$sudo apg-get install ffmpeg
ODOC: bala@bala:~ /home$ du; python sample.py; pwd
We can write multiple commands on one line by separating them with ‘;’ it is
useful when the first command might takes a long time.
ODOC: bala@bala:~ /home$ tar tf xyz.tar
The GNU version of the tar archiving utility. We can list all files within an archieve.
$ tar xvf xyz.tar
This command is used to extract the tar and stores in the current directory.
We can test mic with the followin command.
$ arecord -d 10 /tmp/test-mic.wav
It records for 10 sec. Now it is also easy to play your wave
file with simple alsa utility.
$ aplay /tmp/test-mic.wav
ODOC: bala@bala:~ /home$ seq
This command will prints the sequence of numbers. Also we can increment the
values by specific numbers. We can give start position and end position for
$ seq 5
$ seq 1 2 10
$ seq 5 10
ODOC: bala@bala:~ /home$ apropos
search the manual page names and descriptions. This command searches a keyword in a command description text.
Therefore it is easy to find out what commands are related to keywords when using that as a keyword
Ex: $ apropos partition
addpart (8) – simple wrapper around the "add partition" ioctl
all-swaps (7) – event signalling that all swap partitions have been ac…
cfdisk (8) – Curses/slang based disk partition table manipulator fo…
delpart (8) – simple wrapper around the "del partition" ioctl
fdisk (8) – Partition table manipulator for Linux
mpartition (1) – partition an MSDOS hard disk
partprobe (8) – inform the OS of partition table changes
partx (8) – telling the kernel about presence and numbering of on-…
sfdisk (8) – Partition table manipulator for Linux
This command searches a keyword in a command description text.
Therefore it is easy to find out what commands are related to
partitions when using partition as a keyword:
ODOC: bala@bala:~ /home$ alias sl=ls
create names or abbreviations for commands. Alias can be used to correct our typos on
shell command line. For example we can create sl command to simulate ls command:
$ alias sl=ls
NOTE: to unalias your commands use unalias command.
$ unalias ls
However, creation of aliases with alias command is temporary just for current terminal session.
ODOC: bala@bala:~ /home$ !c
This command executes lastly used command starting with ‘c’. Syntax is
Exclamatory symbol followed by alphabets. If you want to execute the command
starting with the character ‘s’ means you can use $ !s.
ODOC: bala@bala:~ /home$ ps -axu
ps command is used to report a snapshot of the current processes. ps -axu
is used to see every process on the system using BSD syntax. For more info
see the man page of ps command.
$ ps -axu