Created
January 30, 2020 08:41
-
-
Save miladev95/40400d160e606cf15deea14fc0fd0370 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cal : show calendar | |
date : show current date | |
cal -y 1999 : show 1999 calendar | |
cd ./Desktop | |
cd - : forwarrd | |
ls .. | |
ls /home/milad | |
ls -i : ls with inode | |
ls -l : ls with detail | |
file permissions - links - user - group - capacity - last access to file | |
ls -a : all file include hidden file | |
ls -t : files sorted by last created | |
ls -r : reverse | |
ls -R : directory with all path | |
ls -l -R | ls -latr | |
ln dir1 hardlink1 : error - can not create hardlink for directories - just files | |
ln file1.txt hardlink1 | |
ln -s dir1 softlink1 : you can create soft link fo directory and files | |
touch dir1 : change lase access of dir1 - if dir or file doesn't exist create that | |
mkdir directory1 | |
mkdir -p directory1/2/3/4 | |
mkdir /home/user/Desktop/tstDir | |
rmdir directory1 : for empty directory | |
rmdire Untitled\ directory : \ for spaces | |
rm * : delete all file in current directory | |
rm -r directory1 : for directory (empty or not) | |
rm -f dir1 : force delete | |
rm -ri dir1 : ask for subdirectory | |
rm -rv * : delete all file with explain | |
cp filetst.txt /home/user/Desktop | |
cp file1.txt file2.txt file3.txt /home/user/Desktop | |
cp -r test test3 : copy test with all files and directory to test3 | |
cp -i dir1 dir2 : ask for overwrite files | |
cp num?? dir1 : copy all file with 5 character | |
cp [1-3]* dir1 : all file which start with 1-3 and after that anything | |
cp *[1-9] dir1 : all file which start with anything and end with 1-9 | |
cp [[:upper:]]* dir1 : all file which start with upper text and after that anything | lower | alpha | digit | alphanum | |
cp [![:upper:]]*[[:digit:]] dir1 | |
mv file1 /home/user/Desktop | |
mv File_test test : age directory vojod dasht move mikone dar gheyr insoorat rename mikone | |
mv -f file1 dir1 : move with overwrite | |
mv -i file1 dir1 : move with aks for overwrite | |
file imgFile : description of file | |
gedit txtFile1 : graphical edit | |
nano txtFile1 | |
less txtFile1 | |
cat txtFile1 : show file content | |
tac txtFile1 : reverse and show file content | |
head txtFile1 : default 10 line aval file ro miare | |
head -n 20 txtFile1 : 20 line az file ro miare | |
tail txtFile1 : reverse and 10 line of file | |
tail -20 txtFile1 : az enteha 20 khat ro miare | |
tail -f txtFile1 : be file negah mikone va age taghiri rokh dad neshoon mide | |
wc nums.txt | -w : words | -l : lines | -c : capacity | |
20 20 51 nums.txt | |
line - word - capacity | |
!119 : dastoor 119 az history ro ejra mikone | |
history 10 : 10 command akhir | |
ctrl + R : search for command | |
command types : | |
Shell Builtins | |
Executable Programs : writen by language and compiled | |
Shell Script | |
Alias Commands : nam mostaar yek dastoor dige | |
/bin : all linux commands | |
/usr/bin : all user commands | |
type cd : noe dastoor ro mige | |
locate file1.txt : search file | |
locate file1.txt : age peyda nakard - sudo updatedb - locate file1.txt | |
whereis ls : address dastoor va tamamie file haye marboote manand manual page | |
which ls : masire binary file ro neshoon mide | |
whatis ls : show command type | |
alias show_works="nano /home/user/Desktop/file1.txt" | |
alias : show all created alias | |
unalias show_works : delete alias | |
cd /home/usr;nano .bashrc : save alias for access all time and add your alias too alias section | |
file permissions : read - write - execute - owner - group - other | |
-rw- rw- r-- | |
owner group other | |
./test.txt : execute file | |
chmod +x test.txt : add execute file permission | -r :read | -w :write | |
chmod -x test.txt : remove execute file permission | |
octa permisson : | |
owner group other | |
read 4 4 4 | |
write 2 2 2 | |
execute 1 1 1 | |
result 7 7 7 | |
chmod 400 test.txt : owner just can read file | |
which ls;sudo chmod 700 /bin/ls : faghat owner mitone command ls ro ejra kone | |
sudo -i : change user level to root | |
chattr +i importantFile.txt : even root user cannot edit this file | |
lsattr : show atribute of files | |
rename 's/^video_//' *.mp4 : hameye file haei ke ba video_ shoro shodan , video_ ro az esmeshoon haz mikone | |
------------- | |
gsettings set org.gnome.shell.extensions.dash-to-dock extend-height false | |
//flexible dock | |
gsettings set org.gnome.shell.extensions.dash-to-dock extend-height true | |
//prevent dock flexible | |
---------------- | |
steghide embed -cf pic.jpg -ef secret.txt | |
//add secret to pic.jpg | |
setghide extract -sf pic.jpg | |
//extract pic.jpg files | |
--------------- | |
Error When Try open with root : Command 'atom' is available in '/snap/bin/atom' | |
The command could not be located because '/snap/bin' is not included in the PATH environment variable. | |
atom: command not found. | |
export PATH="/snap/bin:$PATH" | |
---------------- | |
Trash Location | |
~/root/.local/share/Trash/ | |
-------------- | |
install adapta theme | |
sudo apt-add-repository ppa:tista/adapta -y | |
sudo apt update | |
sudo apt install adapta-gtk-theme | |
--------------- | |
install bootable windows usb maker program | |
sudo add-apt-repository ppa:nilarimogard/webupd8 | |
sudo apt update | |
sudo apt install woeusb | |
-------------- | |
archive file | |
tar cvf myetc.tar /etc : tar file | |
tar xvf myetc.tar : untar file | |
tar cvzf myetc.tar.gz /etc : tar with gzip | |
tar xvzf myetc.tar.gz : untar file | |
------------- | |
zip file | |
gzip file1 | |
gzip -d file1.gz | |
------------- | |
change display resolution | |
xrandr : show display properties | |
sudo xrandr --addmode DP-1 "1360x768" : DP-1 is display name | |
------------ | |
install gimp | |
sudo add-apt-repository ppa:otto-kesselgulasch/gimp | |
sudo apt-get update | |
sudo apt-get install gimp | |
----------- | |
Github add ssh key | |
Check if ssh key exists | |
ls -al ~/.ssh : if there is file ssh key are generated] | |
Generate ssh key | |
ssh-keygen -t rsa -b 4096 -C "[email protected]" | |
: press enter to save in default path (~/.ssh) then enter passphrase | |
Add ssh key to ssh-agent | |
eval "$(ssh-agent -s)" | |
ssh-add ~/.ssh/id_rsa | |
//then copy ~/.ssh/id_rsa.pub to github accout after that | |
ssh -T [email protected] | |
git remote set-url origin [email protected]:username/repo.git | |
----------------- | |
fix Could not get lock /var/lib/dpkg/lock-open | |
sudo rm /var/lib/apt/lists/lock | |
sudo rm /var/cache/apt/archives/lock | |
sudo rm /var/lib/dpkg/lock | |
sudo dpkg --configure -a | |
---------------- | |
wifi or vpn connect or dissconnect | |
list all connections : nmcli con | |
start connection : nmcli con up connectionName | |
down connection : nmcli con down connectionName | |
------------------ | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment