Useful Linux commands | Janne Honkonen | Professional profile and official site - Janne Honkonen - Official pages of the Janne Honkonen, visual artist

Useful Linux commands

Like with the many operating systems, Linux has a several useful and powerful tools which are only known to the minority of the users who actually needs them or considered as a “power-users” who has both time and interested to get to know these tools.

Following article focuses on the most useful Linux terminal commands and tools you can (and should) use with the Linux operating system. Commands are suitable for both basic and for advanced use. They can help and ease up your day a lot. Please note that some of these tools may not be preinstalled and need to be installed to be used. Certain commands may also be also specific to the Debian Linux system as it is distribution I like to use.

Command Usage example Shortly Long
apt-get apt-get install [packagename] Package handling tool Apt-get, a Debian Linux package handling tool, is a very easy and straightforward tool which enables you to install, upgrade and remove packages to your Linux system. Installing tools and software has never been so easy.
cd cd [directory] Change directory As always with Linux, it’s commands are quite straight forward in names. Cd changes your current directory to one you want. You can always return to file root with “cd /” command.
crontab crontab -e Scheduling system You can set up several different kind of schedules for system to run. Crontab is the most powerful timing tool there is and allows user to control all kind of schedules on the system.
date date Show/set system date/time This command is the fastest way to view system’s date and time as well as set new time to the system in case your clock is somehow ticking the wrong way.
df df Shows free space DF shows free and used hard disk space in different Linux partitions as well as how they are mounted in to the file system.
history history Shows command history Sometimes you need to recall what and how you did things earlier. History commands, as it might indicate, shows your command history in numeral list.
kill kill -9 [pid] Terminate process Sometimes you need to kill (terminate) a process if it takes too much time, makes too much load or is stuck. By giving process id (like one got with “ps -C” or from “top”) it ends the process.
locate locate file File location One of my favorite tools. With Locate you can, well, locate any file you want in the system. Remember to keep your Locate-database up to date with regular “updatedb” commands.
ln ln [target] [linkname] Creates symbolic link Ln creates a symbolic link of the item, such as file or directory, to a specific place. Symbolic link is a virtual placeholder for all sort of items which helps you easing repeated tasks or locations.
ls ls -l Directory lister One of the most basic Linux commands there is. Lists contents of the current directory. When used with -l parameter, uses long list view.
man man [program] Help files Man is a savior of the Linux users. It generally is a help (manual) file viewer for most of the Linux commands and/or programs there is. Just ask the man for help, like “man man” :-).
mkdir mkdir [directory] Make a directory Mkdir creates a directory (folder) in the directory you are currently in or to a specific place if you specify target in same time.
mount mount [device] [directory] Take storage on use Mount is a tool which allows you to “mount”, i.e. take use a certain device or pointer on your Linux. You can use it to get content of any storage device and make it appear in certain directory. Mount /dev/hda2 /mnt/hda2 is a good example.
nano nano [file] Text editor Nano is the “notepad of the Linux”, a fine and lightweight text-editor. It is relatively easy to use and can be used for quickly editing any config, log or other text files.
ping ping [host] Test a host Ping, an old age tool, is good for responding of the network host. Ping sends a “ping”, an UDP network package, to the remote host and lists how fast it replies back.
ps ps -C [processname] Process finder Searches activate processes and finds if process [processname] is active. Returns list of active processes and their PIDs (process IDs).
rm rm [file] Remove a file Rm removes a file you specify. You can remove only a file, or a file like item such as symbolic link.
rmdir rmdir [directory] Remove a directory Rmdir removes a directory (folder) you specify. Directory needs to be empty so it can be removed.
scp scp [file] [host] Transfer files SCP is a secure file transferring software which allows you to transfer files between your client and the target host over SSH connection.
screen screen Screen manager With screen you are able to leave scripts, programs or anything if you want running to your terminal even if close your terminal. Easy to remember: 1) screen 2) start program 3) ctrl-a,ctrl-d and to return 4) screen -r.
ssh ssh [host] SSH connector Connects to the remote ssh-server. Usually ssh is used for connecting between client and server or sometimes between servers.
tail tail -f [textfile] Show end of text file Tail is an excellent tool for viewing last lines of the text file. This tool can be used to view latest log entries or end of the other text files. When used with -f parameter, it keeps listing also new entries.
top top Process lister Lists all the top processes running on the system. This list can sorted several in different ways. Good for finding out which processes are using the resources.
uptime uptime Uptime/load viewer Shows server’s uptime, a fact of how long the system has been running as well as the current load of the system in 1,5 and 15 minutes averages (0.0-1.0=0-100%).
w w Connected users, load and uptime The command “w” is the multitool of the Linux commands. It shows connected users, current load of the system (1,5,15 minutes averages) and uptime of the server.
who who Connected users viewer Who lists all the current connected users to the system and of their connection hosts. Easy to keep on eyes who is connected to your system.

Related Post

*

© Janne Honkonen - www.jannehonkonen.com