Difference between revisions of "Basic Commands"

From 6bit.ch wiki
Jump to navigation Jump to search
Line 1: Line 1:
= hostname =
Shows the current hostname.</br>
<code>-f</code> show FQDN
<code>hostnamectl status</code> (default) show current system hostname and related information.</br>
<code>hostnamectl set-hostname</code> set and apply a new hostname</br>
= last =
Show a list of last logged in users and system boots.</br>
Can be refined with a username/keyword.</br>
= lastb =
Show a list of last failed login attempts.</br>
Can be refined with a username/keyword.</br>
= ls =
= ls =
<code>-a</code> do not ignore entries starting with .</br>
<code>-a</code> do not ignore entries starting with .</br>
Line 29: Line 44:
<code>-R</code> apply recursive</br>
<code>-R</code> apply recursive</br>
<code>-x</code> remove access acl</br>
<code>-x</code> remove access acl</br>
= w =
Display current system information.</br>


= watch =
= watch =
Line 45: Line 63:
= which =
= which =
Locate a command.</br>
Locate a command.</br>
= who =
Display currently logged in users.</br>

Revision as of 10:28, 30 December 2022

hostname

Shows the current hostname.
-f show FQDN

hostnamectl status (default) show current system hostname and related information.
hostnamectl set-hostname set and apply a new hostname

last

Show a list of last logged in users and system boots.
Can be refined with a username/keyword.

lastb

Show a list of last failed login attempts.
Can be refined with a username/keyword.

ls

-a do not ignore entries starting with .
-F append a symbol to indicate type (* executable, / directory, @ symlink, = socket, | named pipe, > door)
-h (with -l and -s) print sizes like 1K 234M 5G
-i display inode number
-l use a long listing format
-r reverse order while sorting
-s display size
-t sort by time, newest first

less & more

space / f scroll forward one screen
enter scroll forward one line
b scroll backward one screen
d scroll forward half a screen
h display help
q quit
/string search string forward
?string search string backward
n find next occurrence
N find previous occurrence (less only)

setfacl

-b remove all access acls
-d apply default acl
-k remove all default acls
-m set or modify acls
-n prevent automatic recalculation of mask
-R apply recursive
-x remove access acl

w

Display current system information.

watch

Execute a command every X seconds (default 2).
watch -n X who execute the who command every X seconds

wc

Display lines (-l), words (-w), bytes (-c) or characters (-m) of file.

whatis

Display one-line man page description of a command.

whereis

Locate the binary, source and man pages for a command.

which

Locate a command.

who

Display currently logged in users.