LinuxCommands

Essentials

CommandDescription
whoamireturns user name
hostnamereturns the name of the host
datereturns date and time
unamereturns kernel version of operating system
passwdallows to change passwrd
historyshows list of recent commands
timemeasures time for command execution
touch *name of file*creates empty file to check if user has a permission to write in folder
lastshows last users login to system
man *command*shows command manual
cdchanges working folder
pwdshows working folder (print working directory)
chvtchenge virtual terminal (chvt 1 has graphical interface)

Navigation

CommandDescription
lsshows list of files and subfolders in the working folder
ls - lshows details about files and folders (see Linux files info)
ls - ashows all files fin folder, including hidden (started with ".")
ls - lrtshows sorted list of file based on modification date
ls - ld *directory*shows the properties of required directory
treeshows folder tree
find *folder* -name "text"finds files in defined folder that have defined text in name

(see also Linux wildcards)

Working with files/folders

CommandDescription
mkdir *dir_name*creates folder (use -p to create parent folder for your subfolder)
cp *source* *destination*copy file(s) from one location to another (use -R to copy directory)
mv *source* *destination*move\rename file from one location to another
rm *object*remove object (use -r to delete folder, use -rf to delete folder without confirmation)

use 2>/dev/null to get rid of standard errors in console

(see also Linux links and Linux file compression)

Pipelines (after "|' sign)

CommandDescription
wcreturns number results number ow rows, words and symbols
grep *test"filter results
xargsapplies command to result line by line

Working with text

CommandDescription
catshow text file content

Working with users and groups

CommandDescription
adduser *username*create a new user
groupadd *groupname*create a new group
wshows log in users with additional info
whoshows log in users with basic info
usermodchange settings for user (adding to group, locking, unlocking)
userdeldelete user
groupdeldelete group
passwd *user*set password for a user
loginctl| manage sessions
Page last modified on August 17, 2021, at 06:42 PM
Powered by PmWiki