Useful Linux/UNIX commands.

Posted: August 29, 2011. At: 10:33 PM. This was 6 years ago. Post ID: 1893
Page permalink.
WordPress uses cookies, or tiny pieces of information stored on your computer, to verify who you are. There are cookies for logged in users and for commenters. These cookies expire two weeks after they are set.

There are many useful Linux commands that are fun to use and can do some very cool things.

cat mysongpart2.mp3 >> mysongpart1.mp3

Using /bin/cat to append the second part of a MP3 file onto the first part, making one large file that will play seamlessly from part one to part 2.

vmstat -a -d

Displaying information about the reads and writes performed by your disks. Example output below.

lovecraft@Shothoth ~ $ vmstat -a -d
disk- ------------reads------------ ------------writes----------- -----IO------
total merged sectors ms total merged sectors ms cur sec
sda 170 3 1384 328 0 0 0 0 0 0
sdb 1532 4161 46414 4180 17 0 136 36 0 2
sdd 27106 616234 4305488 79824 4013 282825 2294704 1908904 0 79
sde 0 0 0 0 0 0 0 0 0 0
sdf 0 0 0 0 0 0 0 0 0 0
sdg 0 0 0 0 0 0 0 0 0 0
sdh 0 0 0 0 0 0 0 0 0 0
sdi 60148 58426 3337678 297136 86521 613992 5600520 3695032 0 473
sr1 40 0 160 140 0 0 0 0 0 0
loop0 0 0 0 0 0 0 0 0 0 0
loop1 0 0 0 0 0 0 0 0 0 0
loop2 0 0 0 0 0 0 0 0 0 0
loop3 0 0 0 0 0 0 0 0 0 0
loop4 0 0 0 0 0 0 0 0 0 0
loop5 0 0 0 0 0 0 0 0 0 0
loop6 0 0 0 0 0 0 0 0 0 0
loop7 0 0 0 0 0 0 0 0 0 0
sdc 748 10451 34111 18732 5502 1486 1210206 24203200 0 212
lovecraft@Shothoth ~ $

Showing all logged in users.

w

Example output below.

lovecraft@Shothoth ~ $ w
22:29:54 up 1 day, 1:30, 4 users, load average: 0.14, 0.27, 0.23
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
lovecraf tty2 Sun21 6:39m 0.80s 0.79s -bash
lovecraf tty3 Sun21 25:29m 0.16s 0.15s -bash
lovecraf tty8 :0 20:35 15:30m 2:43 0.20s gnome-session
lovecraf pts/0 :0.0 22:15 0.00s 0.29s 0.00s w

Deleting files from within a tarball. Excellent tip here: http://www.thelinuxdaily.com/2011/08/remove-a-file-directory-from-a-tarball-without-extracting-first/.

Display a list of all users currently logged into the current machine.

ubuntu ~ $ users
ubuntu

No comments have been made. Use this form to start the conversation :)

Leave a Reply