Essentials
| Command | Description |
| whoami | returns user name |
| hostname | returns the name of the host |
| date | returns date and time |
| uname | returns kernel version of operating system |
| passwd | allows to change passwrd |
| history | shows list of recent commands |
| time | measures time for command execution |
| touch *name of file* | creates empty file to check if user has a permission to write in folder |
| last | shows last users login to system |
| man *command* | shows command manual |
| cd | changes working folder |
| pwd | shows working folder (print working directory) |
| chvt | chenge virtual terminal (chvt 1 has graphical interface) |
Navigation
| Command | Description |
| ls | shows list of files and subfolders in the working folder |
| ls - l | shows details about files and folders (see Linux files info) |
| ls - a | shows all files fin folder, including hidden (started with ".") |
| ls - lrt | shows sorted list of file based on modification date |
| ls - ld *directory* | shows the properties of required directory |
| tree | shows 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
| Command | Description |
| 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)
| Command | Description |
| wc | returns number results number ow rows, words and symbols |
| grep *test" | filter results |
| xargs | applies command to result line by line |
Working with text
| Command | Description |
| cat | show text file content |
Working with users and groups
| Command | Description |
| adduser *username* | create a new user |
| groupadd *groupname* | create a new group |
| w | shows log in users with additional info |
| who | shows log in users with basic info |
| usermod | change settings for user (adding to group, locking, unlocking) |
| userdel | delete user |
| groupdel | delete 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