Useful Linux Commands

2 minutes read

Linux_logo_errorbits.com

Here is a list that contains one of the most used Linux commands, and a short explanation for them: ls – list – lists files and directories, can be used with a lot of options like: -a, -R, -l, -g, -r;

pwd – print working directory – shows the path of the current directory;

ifconfig – interface configuration – used to view and change the configuration of the network;

cd – change directory – used to change the current working directory;

df – disk free – must be used with -h option(the values will be displayed in KB/MB/GB);

du – disk usage – must be used with -h option, -s option will sum the subfolders and files capacity;

grep – global regular expression print – processes text line by line and returns the value that matches the request;

cat / tac – catenate – is the simplest way to display the contents of a file, directly in command line interface / tac reverses the order of the contents;

tail – outputs the last part of the contents of a file;

tee – used to dublicate input and to route it to multiple outputs at once;

touch – used to update the access and modification time of a file, if the file does not exist it is created with the specified name;

mkdir – make directory – used to create directories;

rm – remove – used to remove/delete files or directories;

cp – copy – used to make copies of files and directories;

less – is a simple command line file viewer;

head –  used to display the first part of files;

file – used to determine the file’s type;

wc – word count – counts the words in a file / -m counts characters / -l counts lines;

ln – link – creates links between files;

find – searches the file system for the specified file;

locate / slocate – it searches in a database, it’s faster than “find” but not that accurate;

yum – used to install/remove packages, update/upgrade system (CentOS);

apt or apt-get – used to install/remove packages, update/upgrade system (Ubuntu);

whoami – shows the current user username;

who – shows the list of usernames;

uname – displays the operating system type, -a switch can be used for more details like distribution/version/kernel/release;

less /proc/cpuinfo – shows CPU hardware information;

cat /proc/meminfo – displays used and free memory information;

[updating with new commands…]

Facebook Twitter LinkedIn Telegram Whatsapp Pocket

Related Posts:

Many Linux commands deal with sensitive data like system hardware, passwords or operate under exceptional circumstances. Prevents regular users from executing these commands by mistakes and helps to protect data and system integrity. By logging in as root enab...
Before you start this tutorial is better to know how to get help and details about the commands, when you need it. There are several ways to get help about the commands, but I will present only the most important ones: Using –help as argument for the command E...
Microsoft loves Linux so much that its latest operating system is based on Linux. Azure Sphere OS is designed to run on embedded devices and IoT. Source: Microsoft’s Newest OS is Based on Linux – OMG! Ubuntu!
In terms of stability and security, Linux is ranked the most stable operating system and at the same time, it’s quite easy to maintain and support. One of the reasons why Linux web hosting has gained popularity is its easily accessible configuration files and ...
Ubuntu is an open-source operating system developed by the San microsystems. Linux allows users and in this case developers to make changes to the program without prior authorization from the creator. You can gather a deeper understanding of Ubuntu Linux from ...
Git Commands List