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...
Linux Fedora, often referred to simply as Fedora, is a popular open-source Linux-based operating system that is known for its focus on innovation, community-driven development, and cutting-edge features. Fedora is a free and open-source operating system that i...
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 ...
A Linux operating system is quite different from a Windows operating system. They run off of different open-source operating systems such as Fedora and many more. Although they are not popular amongst regular users, many developers feel that a Linux laptop can...
The Linux operating system has the highest rate of popularity for PCs. It is an open-source code that allows anybody to create their unique operating system. There are many benefits of using the Linux system, including that it is free and stable. Many corporat...