Linux
sudo: super user do
apt: the advanced package tool
To change password of the linux. Open terminal. Type passwd on terminal. Enter your new password and retype new password.
In Linux, upper and lower case matter. / or \ matters.
.
ifconfig => Show IP address.
Remember, this command didn't work and gives the following error. Because ifconfig is not installed!
Then you install by typing sudo apt install net-tools ; Then it worked!
{If you want to install a software you use this command. sudo apt-get install softwarename
To remove; sudo apt-get remove softwarename
you can find the software online and download it. Those software files can be ".sh" , ".bin" , ".deb"}
ping => to ping
whois => to show domain info: Ex: whois google.com
dig => to show DNS info: Ex: dig google.com
history =>gives a list of command you add
clear => clear command line
ls => lists folder
ls -la => lists all folder including hidden ones.
cd => enter to folder
Other Useful Commands:
mv => allows a user to move a file to another folder or directory. EX: mv Documents/Videos/abc.doc Music ; It moves abc.doc from Documents/Videos to Music folder. For this example; it must be at root folder. (See the picture below)
rm=> allows a user to remove a file.
rmdir => allows a user to remove directory.
man=>show the manual or all relevant information for a command. EX: man cd ; it gives details related cd command. (command --help ; do same thing. Ex: ls --help ; it gives details of ls)
top =>shows all process. you will see PID. If you type kill PID#; you will stop that process.
kill 50 ; If you type like that. And if 50 is firefox PID#. firefox will be closed!
top =>show active process
top aux =>show all process
find => to find EX:find /home
date => to show date and time
pwd => to see where it is
cal=> to show calendar
cp=> to copy. Ex: cp file1 file2 =>copy file1 to file2
cat => to see index of the file on command panel. Ex: cat file_name
cat /proc/cpuinfo => to show cpu info
w => to summarize the system data
whoami => to show the user
free => to show how many RAM is used
tar cf foldername.tar.gz foldername => to zip as gzip. Ex: tar cf Documents.tar.gz Documents
apt: the advanced package tool
To change password of the linux. Open terminal. Type passwd on terminal. Enter your new password and retype new password.
In Linux, upper and lower case matter. / or \ matters.
====================================================================
Ctrl + Alt + T => Open the command window on Linux.
ifconfig => Show IP address.
Remember, this command didn't work and gives the following error. Because ifconfig is not installed!
Then you install by typing sudo apt install net-tools ; Then it worked!
{If you want to install a software you use this command. sudo apt-get install softwarename
To remove; sudo apt-get remove softwarename
you can find the software online and download it. Those software files can be ".sh" , ".bin" , ".deb"}
ping => to ping
whois => to show domain info: Ex: whois google.com
dig => to show DNS info: Ex: dig google.com
history =>gives a list of command you add
clear => clear command line
ls => lists folder
ls -la => lists all folder including hidden ones.
cd => enter to folder
mv => allows a user to move a file to another folder or directory. EX: mv Documents/Videos/abc.doc Music ; It moves abc.doc from Documents/Videos to Music folder. For this example; it must be at root folder. (See the picture below)
Otherwise, the file will be renamed, not moved! If you are in the folder, the moved folder should be in there too!
As a summarize; if you want to move a folder; you need to be en distaki yerde.
touch => allows users to make files using the Linux CLI. Just as the mkdir command makes directories, the touch command makes files. Just as you would make a .doc or a .txt using a PC desktop, the touch command makes empty files.
mkdir=> make directory
rm=> allows a user to remove a file.
rmdir => allows a user to remove directory.
man=>show the manual or all relevant information for a command. EX: man cd ; it gives details related cd command. (command --help ; do same thing. Ex: ls --help ; it gives details of ls)
top =>shows all process. you will see PID. If you type kill PID#; you will stop that process.
kill 50 ; If you type like that. And if 50 is firefox PID#. firefox will be closed!
top =>show active process
top aux =>show all process
find => to find EX:find /home
date => to show date and time
pwd => to see where it is
cal=> to show calendar
cp=> to copy. Ex: cp file1 file2 =>copy file1 to file2
cat => to see index of the file on command panel. Ex: cat file_name
cat /proc/cpuinfo => to show cpu info
w => to summarize the system data
whoami => to show the user
free => to show how many RAM is used
tar cf foldername.tar.gz foldername => to zip as gzip. Ex: tar cf Documents.tar.gz Documents
tar xf foldername.tar.gz foldername => to unzip Ex: tar xf Documents.tar.gz
Alias on Linux:
You can create alias (takma isim) on Linux to change any command. Example: make sec alias of cd.
Open command prompt.
Type vim /etc/bash.bashrc ( We open /etc/bash.bashrc via vim.)
Then press i letter to be able to insert.
Type alias sec="cd"
Press Esc
Type :wq to exit.
Restart you command prompt and you can use sec as cd.
File Permission on Linux:
r = 4
w=2
x=1
So, owner rwx (4+2+1=7) & group member r-- (4+0+0 =4) & other (public) r-- (4+0+0 =4)
When you type ls -al on commnad prpoerties and permissions of the files.
To change permission on a file; we use chmod Ex: chmod 777 test.txt We change the permission of file. We give rwx (4+2+1=7) permissions for all users.
Editor on Linux:
Nano and vi are default editors. To install vim as an editor.
Type sudo apt-get install vim on command prompt. Wim will be installed.
Alias on Linux:
You can create alias (takma isim) on Linux to change any command. Example: make sec alias of cd.
Open command prompt.
Type vim /etc/bash.bashrc ( We open /etc/bash.bashrc via vim.)
Then press i letter to be able to insert.
Type alias sec="cd"
Press Esc
Type :wq to exit.
Restart you command prompt and you can use sec as cd.
File Permission on Linux:
r = 4
w=2
x=1
So, owner rwx (4+2+1=7) & group member r-- (4+0+0 =4) & other (public) r-- (4+0+0 =4)
When you type ls -al on commnad prpoerties and permissions of the files.
To change permission on a file; we use chmod Ex: chmod 777 test.txt We change the permission of file. We give rwx (4+2+1=7) permissions for all users.
Editor on Linux:
Nano and vi are default editors. To install vim as an editor.
Type sudo apt-get install vim on command prompt. Wim will be installed.
Comments
Post a Comment