All basic commands to start with Linux
1) Action on files and directories
cd [directory_name] : To change the current directory.
ls [options] [file_name] : Only, ls list the files in the current directory. If one or more names are specified, ls displays the files that belong to the named directories or whose name is one of those specified.
pwd : Displays the absolute path of the current working directory.
cp [options] file1 file2 : Copy file1 to file2. If the destination is an existing file, it will be overwritten.
touch file : Create an empty file. ">" Is an equivalent command.
tar [-] key [options] [files] : Manages a set of associated files in a backup file. This is used to facilitate the transport of multiple files. The file list may contain directories; the files and directories contained in these will be archived keeping the initial tree.
to concatenate multiple files into a new file. In the same way the operator ">>" allows you to add files at
the end of an existing file.
more file : Displays the file in a terminal page by page. Some keys allow navigate and change the display.
less file : View the contents of a file directly in the terminal.
chgrp [group_name] file : Change the group of a file or directory. Only the owner of the file (or root) can do this manipulation.
chmod [options] file mode : Change the access rights (in a certain mode) of one or more files. Only the owner of the files or a user with special rights can change the access mode. The access mode format consists of three parts: level(s) Operation Right(s). If no level is specified, the change is made at all levels. Only one operation is possible at a time.
umount [options] [device_name] : Unmount a file system.
eject [device_name] : Eject an optical media from a drive.
lspci [option] : List all PCI devices.
lsusb [option] : List all USB devices.
ntfsfix [options] device : Fix NTFS errors.
dosfsck [options] device : Checks and repairs an MS-DOS file system.
mkfs [options] partition : Format a partition with a given file system.
dumpe2fs [options] partition : Displays the health information of partitions formatted in ext2 / ext3 or ext4.
ps [options] [PIDs] : Displays the list of active processes.
kill [options] IDs : Ends one or more processes referenced by their IDs.
df [options] : Displays the amount of disk space used by the file systems.
du [options] : Displays the space used by directory.
free [options] [names] : Displays the available & used memory of the system.
uptime : Gives a line of information about the machine: the time, how long the machine has been running, how many users are logged in and the computing load averaged over 1.5 and 15 minutes.
adduser user : Adds a local user. This command requests additional information (password, full name, office number, business phone, personal phone, other).
usermod [options] user : Changes the settings of a user account.
userdel [options] user : Deletes a user account and associated files.
groupdel group : Deletes a group on the system.
groups username : Shows the groups to which belongs a user.
id username : Displays the user and group information for a specified user, or if no user is specified, it displays information about the current user.
ifdown [options] [interface] : Disables network interfaces.
ifup [options] [interface] : Enables to activate the network interfaces.
route [options] : Displays / manipulates the routing table.
dpkg-reconfigure software_name : Utility to reset default binaries.
apt-get [options] software_name : Utility to manage software (Debian / Ubuntu).
aptitude [options] software_name : Utility to manage software (Debian).
apt-cache [option] software_name : Utility giving a list of packages whose name contains software_name.
yum [options] software_name : Utility to manage software (CentOS / Redhat).