Basic cmd:
To run a terminal:
Alt + clt + t
Alt + clt + F1
Alt + clt + F7 (close terminal)
Change directory:
$ cd work/data/
Show present working directory:
$ pwd
Copy file:
$ cp src/file dest/newfile
Move file
$ mv src/file dest/newfile
Remove file:
$ rm filename
Remove directory with files:
$ rm -r directory_name
Change file permission type:
$ chmod 000 filename
Read a file:
$ cat filename
Concatenate a file with another:
$ cat old_file new_added_filename
Make a directory:
$ mkdir directory_name
List files of directory:
$ ls -l
List files of directory and show size in kilobytes:
$ ls -lh
List all text type files:
$ ls *.txt
$ ls *.py
To show all hidden file:
$ ls -a
Concatenate files:
$ cat oldfile > new_file # old file will add on new_file
$ cat oldfile >> updated_file # old file will add after updated_file
Show process:
$ ps
Show differences among two files:
$ diff file1 file2
Search a file:
$ find filename
Print recently used commands:
$ history
Clear the terminal:
$ clear
Kill a process:
$ kill process_id
Reboot the system:
$ reboot
Install software:
$ sudo apt-get install software_name
$ sudo apt-get update
$ sudo apt-get upgrade
To know about running operation system:
$ uname -r # r means release date
$ uname -v # v means version number
Search word in a file:
$ grep ‘data mine’ -i -n file_name
# -i means case insensitive
# -n means show result in new lines
To count word of a file:
$ wc -w filename
$ wc -lwc filename
Pipe command:
To run two commands jointly:
$ ls | wc -l # it will show how many files in the directory
$ who | wc -l # how many users are there
$ who | sort > filename # after sorting username, it will write it in the file
Networking command:
$ netstat -at # show all tcp port
$ netstat -s # show statistic
Downloading all files of a folder:
scp -r user@host:/path/to/folder/ local-copy-of-folder
Copy something from this system (your local drive) to some other system:
scp /path/to/local/file username@hostname:/path/to/remote/file
Other commands:
How can change your password:
$ passwd
Where you can find user’s password:
$ cat /etc/passwd
Open a file with default software:
$ gnome-open filename.pdf # filename.jpg
Pdf / adove file reading:
$ evince filename.pdf
Make a hidden file:
$ vi .hidden
To show all hidden file:
$ ls -a
____________________________
Vim command:
there are some modes. Like: i for insert. Escape for changing mode.
Open a file or create a new file:
$ vim filename.py
To start typing: press i or s
Then, you should start typing
To Exit: press escape and
:x #saving the file
:q #quit without saving
Clt+z #quit without saving
Copy-paste: copy lines from other file. Then click on mouse-right click. It will paste those lines
মন্তব্যসমূহ
একটি মন্তব্য পোস্ট করুন