Linux – Commands


Resources – An A-Z Index of the Bash command line for Linux


In short

Display the system hour
$ date

Modify the hour
# date -s HH:MM:SS

Modify the date
# date -s MM/JJ/AAAA

Display the server bios hour
$ hwclock
Synchronize the system hour with the bios hour
# hwclock --systohc

Change of user
$ su - username2

Path following by a packet to a server / machine
$ traceroute IPorDomainName

Debug a script
# bash -x

Display some information
uname -a           ## kernel version
uname -p           ## CPU - standard
cat /proc/cpuinfo  ## CPU - advanced (Model, speed, cache size, etc.)
cat /proc/meminfo  ## Memory (MemTotal, MemFree, SwapTotal, SwapFree etc.)

Display the system's users
$ cat /etc/passwd

Display the system's groups
$ cat /etc/group

Clear screen (equivalent to cls)
$ clearscreen
ctrl + l

Delete a user / group
$ deluser –remove-home username
$ delgroup groupname

Display disk usage
$ df –h

Display disk usage of a folder
$ du –h {folder}

Display memory
$ free

Modify the owner of a file/folder
$ chown user file
$ chown user:groupfichier

Search of a specific sentence (pattern) in a file tree .php
find . -name "*.php" -print0 | xargs -0 egrep pattern

Apache2 – graceful restart
# apachectl -k graceful

Search in the command history
ctrl + r

Empty the cli which is in use
ctrl + w

Leave a Reply

Your email address will not be published. Required fields are marked *