|
pwd
|
Where am I in the system
|
|
ls [path]
|
List of given path. Common params -l -h -a
|
|
cd [path]
|
Change directory
|
|
~ (tilde)
|
Used in paths as a reference to your home directory (eg. ~/Documents )
|
|
. (dot)
|
Used in paths as a reference to your current directory (eg. ./bin ).
|
|
.. (dot dot)
|
Used in paths as a reference to your current directories parent directory (eg. ../bin ).
|
|
[KEY] TAB
|
Start typing and press TAB. The system will auto complete the path. Press TAB twice and it will show you your alternatives.
|
|
mkdir <dir name>
|
create directory
|
|
rmdir <dir name>
|
remove empty directory
|
|
rm <path>
|
remove file also non-empty folder with -f param (-r recursively)
|
|
touch <file name>
|
create empty file
|
|
cp <source> <destination>
|
copy source to destination
|
|
mv <source> <destination>
|
move source to destination also used for rename
|
|
head
|
show the first n lines (-n)
|
|
tail
|
show the last n lines (-n)
|
|
sort
|
sort lines in a given way
|
|
wc
|
How many words, characters and lines.
|
|
grep
|
search for given patters
|
|
*
|
Zero or more characters (eg. b*).
|
|
?
|
Single character (eg. file.???).
|
|
[]
|
Range (eg. b[aio]t).
|
|
du -sh [dir/file]
|
Disk usage (-s summary -h humman readable)
|
|
df -h
|
Display how much disk space is used and also free
|
|
find /home -mtime -1
|
Find all files in the given directory (and subdirectories) which have been modified in the last 24 hours.
|
|
shutdown -h now
|
Shutdown the system. (Replace -h with -r for reboot.)
|
|
reboot
|
Restart machine
|
|
date
|
Show the current date and time
|
|
whoami
|
who you are logged in as
|
|
finger <user>
|
display information about user
|
|
man <command>
|
show the manual for command
|
|
whereis <app>
|
show possible location of app
|
|
which <app>
|
show which app will be run by default
|
|
r
|
read
|
|
w
|
write
|
|
x
|
execute
|
|
permission order
|
Owner(user) Group Other
|
|
chmod <permissions> <path>
|
hange permissions. Permissions can be either shorthand (eg. 754) or longhand (eg. g+x)
|
|
>
|
Redirect STDOUT to a file.
|
|
>>
|
Redirect STDOUT to a end of file.
|
|
2>
|
Redirect the STDERR to a file.
|
|
<
|
Pass the contents of a file to a program as STDIN.
|
|
|
|
Feed the STDOUT of the program on the left as STDIN to the program on the right.
|
|
Config files virtual hosts
|
/etc/httpd/conf/httpd.conf
|
|
hosting.znojmo.cz
|
/etc/httpd/conf.d/virtualy.conf
|
|
Restart service gracefull
|
apachectl graceful
|
|
Restart service hard
|
sudo service apache2 restart
|
|
Log file
|
/var/log/httpd
|
|
ispconfig specific
|
/var/www/web1/log/
|
|
New virtual
|
web-uzivatel
|
|
Config files
|
/etc/mysql/
|
|
/etc/mysql/conf.d/
|
|
|
Restart service
|
service mysql restart
|
|
service mysqld restart
|
|
|
/etc/init.d/mysqld restart
|
|
|
Status service
|
systemctl status mysql.service
|
|
Log file
|
/var/log/mysql/error.log
|
|
CTRL + C
|
Cancel the currently running process
|
|
kill <process id>
|
Cancel the given process. Include the option -9 to kill a stubborn process
|
|
ps
|
Obtain a listing of processes and their id's. Including the option aux will show all processes.
|
|
jobs
|
See a list of current processes in the background.
|
|
CTRL+ Z
|
CTRL + Z Pause the currently running process and put it in the background.
|
|
fg <job number>
|
Move the given process from the background to the foreground.
|
|
Do you want help with this cheatsheet
|
Contact me at info@davidstein.cz
|
No comments yet.
Cheatography n. The art of mapping complex subjects into clear, instantly navigable reference guides.