Základní příkazy v Linuxu

Muj menší přehled základních příkazů pro linux. Neobsahuje to tu zde všechny příkazy, bylo to jen vytvořeno pro pracovní účely. Pokud se mi bude chtít, tak to rozšířím o další příkazy.

Pozn. překládat se mi to zatím nechce ,sice jsem to plodil já, ale teď na to nemám náladu :D tak dokud se někdo neozve tak to tu bude v ENU langu :-P

Příjemné počteníčko.

Basic command’s under Linux:

1.      How to start linux terminal?

a)      Press Alt+F2 and type gnome-terminal (terminal) or,

b)      Click on “Computer” in left bottom corner and click on “Gnome-terminal” icon (if you don’t see this icon, click on “More Applications….”and in search you enter “terminal” and now you see gnome-terminal icon.

2.      Man’s pages

man cd -> showing manual page to cd command

3.      Move between folder’s

cd /some/folder/

Tip: You can use TAB key to fill folder which is in actual folder, e.g. you write /ho and pres TAB key and it’s automatically fill /home/

cd .. –> change folder, up level

cd / -> change to / folder

cd ~ -> change to user’s home folder (e.g. su (superuser – root) folder is /root/, user - /home/user/)

4.      Actual folder

pwd

5.      Directory list

ls

ls –la -> detailed directory list with rights, size, date last modification and name of file,

ls –la |grep nam -> detailed directory list with select file name containing “nam”

6.      Create folder

mkdir folder_name or

mkdir /home/user/folder_name/

7. Copy file, folder, ..

cp file file_copy

cp file /home/some_folder/file_copy

8. Move file, folder,.. or rename file

mv file file_new -> rename file to file_new (only in current directory)

mv file ~/files/ -> move file “file” to folder files in home directory, with same name

9. Remove file, files..

rm file or you can use * for selecting remove

rm file*.txt

10. Remove folder

rmdir folder_name -> only empty folder

rmdir –r folder_name -> erase al subfolders and files in folder “folder_name”

11. Extract *.gz file

gunzip file.gz

12. Extract tarball

tar –xvf file.tar

12. Find file

find file

find / -name blabla.txt

find /usr/bin/ |grep firefox -> find firefox in /usr/bin/ folder

13. Search file of program

which firefox -> list where is locate program firefox, e.g. /usr/bin/firefox

14. List of file

cat novy_textak.txt -> list of file

cat /etc/samba/smb.conf  |less -> parameter LESS is screen viewing of file (arrows “Up, Down” move by lines, “space” move by screen, “q” end of viewing)

15. Change right of file

Are 2 ways to change helpfully this command “chmod”

a)      chmod u+rwx,g+r,o+r file_name -> change rights to: (u)ser – read, write, executable , (g)roup – read , (o)thers – read

b)      chmod 640 file_name -> change rights to: user (6) = r(4) + w(2), g roup (4) = r(4), others (0) = 0 :D , because read=4, write=2 and executable=1,

for all rights -> chmod 777 file_name -> 4(r)+2(w)+1(e)=7

For same rights we can use – (minus) for remove rights. Directory are show in list of directory by “d”, so if you using ls –la command for folder with all rights:

drwxrwxrwx  2  user  user  300  Sep  8  21:15  folder_name

Notice: is very dangerous to use all rights for another users except owner!

System commands:

1. Show architekture of PC

arch

2. Network interfaces

ifconfig

3. Which distribution we use?

lsb_release –a

4. Name of hostname

hostname

5. List of all devices in computer

lspci

6. List of all USB storage connected to PC

lsusb

7. List of runing proceses with use memory and %CPU usage

top -> quit by press „q“ key

8. Change password for user

passwd pepa_z_depa

9. Add user

adduser franta

10. Shutdown or restart

shutdown –h now or halt -> halt system (turn off)

shutdown –r now or reboot -> restart, reboot

shutdown –r 5 -> system is restarting after 5minutes, for all of these command you must be as root

11. Show actual date and time

date

RPM’s package:

Installation rpm package:

rpm –ivh package_to_install.rpm

Remove package:

rpm –e package_to_remove.rpm

Yum installer:

To install packages from official repositories from distribution:

yum –y install rpm_package.rpm

yum remove rpm_package.rpm

yum list -> list of all installed packages

yum search rpm_package.rpm -> find rpm package from repository

yum clean all -> clean cache packages

Powered by Drupal - Design by Artinet