This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
linux:scripts:basics [2014/10/01 13:21] – lunetikk | linux:scripts:basics [2014/12/04 11:28] – [Not enough rights] lunetikk | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | |||
- | ===== Linux Commands ===== | ||
- | |||
- | ^ Command | ||
- | | cd / | ||
- | | pwd | shows current directory | ||
- | | ls | shows all files and folders in the current directory in one line -> confusing) | ||
- | | ll | = ls –al -> shows all files and folders + owner + size, 1 item each line |\\ | ||
- | | alias | shows alias like „..“ for „cd ..“ |\\ | ||
- | | cat [textfile] | ||
- | | tail [-f -n 20] | displays the last 20 lines of the file – extension „–f“ refreshes the file, extension „–n 20“ displays the last 20 lines |\\ | ||
- | | head | same a tail but it displays the first lines |\\ | ||
- | | touch [file] | ||
- | | chmod 777 [file] | ||
- | | chown user:group [directory] –R | change owner and group, -R changes the complete directory including files and subdirectorys | ||
- | | useradd –m | add a user |\\ | ||
- | | groupadd | ||
- | | cp source target [-r -a] | copy data, -r copy directory, -a keep the rights | ||
- | | mv source target | ||
- | | rm –r | removes a directory with all data in it / rmdir only removes empty directorys | ||
- | | cut –d : -f 1,3 | : is the delimiter and 1 and 3 are the columns | ||
- | | echo " " > test.sh | ||
- | | which sutp | shows path of sutp |\\ | ||
- | | echo $? | 0 = success of the last command | ||
- | | env | run a program in a modified environment | ||
- | | uptime | ||
- | | mkdir –p / | ||
- | | rpm –ivh | ||
- | | mount / | ||
- | |||
- | |||
- | ===== Debian Commands ===== | ||
- | |||
- | ^ Command | ||
- | | apt-cache search [Package] | ||
- | | apt-get install [Package] | ||
- | | apt-get update | ||
- | | apt-get upgrade | ||
- | | apt-get remove [Package] | ||
- | | apt-get purge [Package] | ||
- | | dkpg --install [Package.deb] | ||
- | | aptitude install [Package] | ||
- | | service [Service] start/ | ||
- | |||
- | |||
- | \\ | ||
- | == EasterEggs == | ||
- | |||
- | ^ Command | ||
- | | apt-get moo | Try it out ;) |\\ | ||
- | | aptitude moo | Try it out and add aptitude -v[vvvvv] moo ;) |\\ | ||
- | |||
- | |||
- | |||
====== Script ====== | ====== Script ====== | ||
Line 81: | Line 27: | ||
Fix:\\ | Fix:\\ | ||
- | Make your script | + | Make your script |
< | < | ||