Everyday Terminal Commands and Applications

Using terminal for your everyday jobs makes everything faster. For example, I was using Thunderbird as my main mail client. Recently, I switched to mutt which is a commandline application that takes care of your e-mails. Mutt is far more faster and simple. Because mutt doesnt have a heavy GUI. For me there is probably nothing that you cant do in mutt but in Thunderbird. I’m just using it for checking my mails and everything seems faster with mutt.

All the commands and applications that I’ll mention will be simple and easy to use. I really have a bad memory, I cant memorize the parameters and stuff. So this will be a simple guide for simple jobs.

Before beginning  you should find a good terminal for you. I’m currently using Guake which is fastest to use. It is a drop-down terminal for GTK environments. Its invoked by a single key, and hidden by pressing the same key again. Using a drop-down terminal is really easy and fast. Also if you are using KDE, you should consider Yakuake.

Very Basic Commands

  • ls – Displays a list of files in the current working directory
  • cd directory – change directories
  • pwd – display present working directory
  • cat textfile – throws content of textfile on the screen
  • cp source dest– copy files and directories
  • mv source dest – move or rename files and directories
  • rm file – remove files and directories. With -r parameter you can remove folders recursively.
  • mkdir dirname – create directories

Some Key Combinations For Terminal

  • Ctrl+C – End a running program and return the prompt.
  • Ctrl+D – Log out of the current shell session, equal to typing exit or logout.
  • Ctrl+R – Search command history.
  • Ctrl+Z – Suspend a program. When you suspend a program, it waits or runs in background. fg command brings the most recent program to foreground.
  • Tab – Command or file name completion.
  • Tab Tab – Shows file or command completion possibilities.

Task Managing

  • killall process_name – kills the process. Using it with -SIGTERM parameter will terminate the process. So use it with that parameter when a process freezes.
  • top or htop – task managers. htop is a better choice but its not installed by default, just install it from your package manager and there you have a fully featured easy to use task manager.
  • free – shows memory and swap usage. using it with -h or –human parameter can be good for your eyes.
  • which app_name – shows the path of the application. Like, which firefox returns /usr/bin/firefox.

File Operations

  • command > output.txt – prints the output of the command to output.txt. This works for nearly all commands.
  • cat file.txt – prints content of file.txt to screen.
  • touch file.txt – creates file.txt
  • chmod – changes permissions of file.
    • owner/group/others
    • 4 – (r)ead. 2 – (w)rite. 1 – e(x)ecute.
    • chmod 777 file will give read write and execute permissions for everyone.
    • chmod +x file will give execute permission to user. Other permissions wont changes.

Other Useful Commands

  • uptime – shows uptime of system. Using with –pretty parameter can be more useful.
  • cal – shows a calendar.
  • date – show the date.

Useful Terminal Applications

  • htop – as I mentioned above, an improved version of top which is a task manager.
  • mutt – an email client. Check here for usage.
  • cmus – a music player. Check here for usage.
  • wget – a download manager.
  • alsamixer – you can adjust nearly everything about sound from here.
  • cowsay and cmatrix are worth checking out.

 

Leave a Reply