Linux Commands
Basic Linux Commands
Install .deb files
| sudo dpkg -i package_file.deb
|
Remove an application
| sudo apt remove application-name
|
Create a new file
Search a file that you don't remember exactly the name
- Search files that contains "school" and "note".
Search text in a given file
- Search all lines in file notepad.txt that contains word "blue"
View first lines of any text file.
- Show the first five lines.
View the last 10 lines of any text file.
Compare 2 files line by line
- Show lines that are different between 2 files.
| sudo tar -xvf filename.tar
|
Turn Off Swap Memory
Open Folder UI From Terminal
- Use the command below to open the current folder UI from terminal
- If you want to open a specific folder UI from terminal then you can put the path.
| xdg-open xdg-open ~/Downloads
|
Install .rpm files
sudo rpm -i package_file.rpm
Fix Can't Mount Drive NTFS
sudo ntfsfix <drive lable>
# Example
sudo ntfsfix /dev/sda
Mount Drive By Terminal
- Create a folder for mounting
1
2
3
4
5
6
7
8
9
10
11
12
13 | NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS │ 2367* sudo umount /dev/sda
loop0 7:0 0 4K 1 loop /var/lib/snapd/snap/bare/5 │ 2368 cd
loop1 7:1 0 63.9M 1 loop /var/lib/snapd/snap/core20/2105 │ 2369 clear
loop2 7:2 0 349.7M 1 loop /var/lib/snapd/snap/gnome-3-38-2004/143 │ 2370* sudo umount /dev/sda
loop3 7:3 0 91.7M 1 loop /var/lib/snapd/snap/gtk-common-themes/1535 │ 2371* ls
loop4 7:4 0 40.9M 1 loop /var/lib/snapd/snap/snapd/20290 │ 2372* sudo mount /dev/sda /home/duc/Shared
loop5 7:5 0 417.2M 1 loop /var/lib/snapd/snap/wine-platform-7-stable-core20/6 │ 2373* systemctl deamon-reload
loop6 7:6 0 495.1M 1 loop /var/lib/snapd/snap/wine-platform-runtime-core20/91 │ 2374* systemctl daemon-reload
sda 8:0 0 465.8G 0 disk │ 2375 history
sdb 8:16 0 238.5G 0 disk │ 2376* sudo systemctl daemon-reload
├─sdb1 8:17 0 600M 0 part /boot/efi │ 2377* clear
├─sdb2 8:18 0 1G 0 part /boot │ 2378* ls
└─sdb3 8:19 0 236.9G 0 part /home
|
| sudo mount <disk> <mount folder>
|
| sudo mount /dev/sda /home/duc/share
|
| sudo mount -o rw,user,uid=1000,dmask=007,fmask=117 /dev/sda /home/duc/Shared
|