Category Archives: cli

PHPHOST BLOG

Web Hosting Related Articles You May Need

Make that last command into a Linux script

You have been trying combinations to see which command line options best fit your needs, and you’ve finally found it. Now let’s make that into a script. You could revert to the last command using your Up key, copy the string, create a new file, paste the string, save the file. Or you could simply
echo [...] Continue reading

Posted in cli, Syndicated, System | Leave a comment

Extract a tarball online without local saving

This can be a real saver if you are using an EeePC with very low disk space. Say you want to download a large file but you don’t want to save it locally because you don’t have the necessary disk space. Do a
wget -qO – “http://www.site.com/archive.gz” | tar zxvf – Continue reading

Posted in cli, networking, Syndicated | Leave a comment

Impress your friends with your CLI magic in Linux

Here are two one-liners to have fun with. The first one takes a block of text you input it and displays it one character at a time, creating the impression that someone else is typing:
echo “I have a troll in my Linux box that is doing all the work for me” | pv -qL 10
The [...] Continue reading

Posted in cli, Syndicated | Leave a comment

Leave no traces in your .bash_history file

If you wish to not leave traces of your CLI activity in the .bash_history file, you can exclude the logging of certain commands by appending a space character before them. For example, press the space bar before you type cat /etc/passwd:
<space>cat /etc/passwd Continue reading

Posted in cli, Security, Syndicated, System | Leave a comment

Quickly query Wikipedia by using the Linux CLI

Stuck at a CLI prompt in Linux and not sure what Romania is? Use the following command:
dig +short txt Romania.wp.dg.cx
Subsitute Romania for any other keyword you might want to see a short description of in your command line.

Continue reading

Posted in cli, networking, Syndicated | Leave a comment

Monitor your changed files in real-time in Linux

Everybody knows top or htop. Ever wished there was something similar but to monitor your files instead of CPU usage and processes? Well, there is.Run this:
watch -d -n 2 ‘df; ls -FlAt;’
and you’ll get to spy on which files are getting written on your system. Every time a file gets modified it will get highlighted [...] Continue reading

Posted in cli, Security, Syndicated, System | Leave a comment

Check your unread GMail e-mails using the Linux command line

All you need to display your latest GMail messages in the command line is this one-liner:
curl -u username:password –silent “https://mail.google.com/mail/feed/atom” | tr -d ‘\n’ | awk -F ‘<entry>’ ‘{for (i=2; i<=NF; i++) {print $i}}’ | sed -n “s/<title>\(.*\)<\/title.*name>\(.*\)<\/name>.*/\2 – \1/p”
Substitute username:password with your GMail username and password. Continue reading

Posted in cli, networking, Syndicated | Leave a comment

Record your Linux desktop from the command line

If you do not wish to install a dedicated application for recording your desktop, you can do it with this one-liner:
ffmpeg -f x11grab -s wxga -r 25 -i :0.0 -sameq /home/user/out.mpg
All you need is have ffmpeg already installed (and most systems do). … Continue reading

Posted in cli, Multimedia, Syndicated | Leave a comment

How to quickly access a CLI text editor in Linux

Need a text editor in the CLI and you’re absolutely too lazy to type nano or vi? Quickly press in order Ctrl+x+e in the command line to open up nano.

Continue reading

Posted in Applications, cli, Syndicated | Leave a comment

Display the current directory as a webpage in Linux

Do you want to quickly serve a directory to your friends over the web or LAN? There are plenty of applications out there that let you do this, but in Linux all you really need is Python installed.Do a
python -m SimpleHTTPServer
in the directory you wis… Continue reading

Posted in cli, networking, Syndicated | Leave a comment