The famous selection of Linux bash commands: Difference between revisions

From chriesibaum wiki
Jump to navigation Jump to search
(Created page with "= File System Tools = '''Disk usage''' - Summarize disk usage of the set of FILEs, recursively for directories. <syntaxhighlight lang="bash"> du -d2 -h </syntaxhighlight> '...")
 
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
= User Management =
'''usermod''' - modify user settings. Add a user to a group
<syntaxhighlight lang="bash">
usermod -a -G <examplegroup> <exampleusername>
</syntaxhighlight>
E.g. add user geek to the sodo group:
<syntaxhighlight lang="bash">
usermod -a -G sudo geek
</syntaxhighlight>
= File System Tools =
= File System Tools =
'''Disk usage''' - Summarize disk usage of the set of FILEs, recursively for directories.
'''du: disk usage''' - Summarize disk usage of the set of FILEs, recursively for directories.
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
du -d2 -h  
du -d2 -h  
Line 9: Line 22:
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
df -h  
df -h  
</syntaxhighlight>
'''ssh''' - Secure Shell
Connect to a remote host
<syntaxhighlight lang="bash">
ssh <user>@<host name / ip address>
</syntaxhighlight>
Run a command on the remote host
<syntaxhighlight lang="bash">
ssh <user>@<host name / ip address> '<command to run>'
</syntaxhighlight>
</syntaxhighlight>

Latest revision as of 09:09, 13 October 2021

User Management

usermod - modify user settings. Add a user to a group

usermod -a -G <examplegroup> <exampleusername>

E.g. add user geek to the sodo group:

usermod -a -G sudo geek


File System Tools

du: disk usage - Summarize disk usage of the set of FILEs, recursively for directories.

du -d2 -h


df - Show information about the file system on which each FILE resides, or all file systems by default.

df -h


ssh - Secure Shell Connect to a remote host

ssh <user>@<host name / ip address>


Run a command on the remote host

ssh <user>@<host name / ip address> '<command to run>'