user@machine:~$ sudo apt update # Update
user@machine:~$ sudo apt upgrade # Upgrade
user@machine:~$ sudo apt update && sudo apt upgrade # Update and Upgrade Together
-
user@machine:~$ ls <!-- --> # View all visible file and directory user@machine:~$ ls -1 # View in a single-line user@machine:~$ ls -a # View everyting includes ( ., .., .anyName ) user@machine:~$ ls -A # View everyting except ( ., .. ) user@machine:~$ ls -l # View all visible with their details and long list formating ( l ) user@machine:~$ ls -lh # View all visible with their details and human readable file size ( h ) user@machine:~$ ls -d */ # View only directories user@machine:~$ ls anyDirectory # View all visible file and directory for anyDirectory user@machine:~$ ls -F # Indicate directory following /
-
user@machine:~$ ls -tlh | head -6 # sort by last modification of time ( t )
-
user@machine:~$ ls *.fasta # View all .fasta extension files user@machine:~$ ls *.fasta | wc -l # View the total number of .fasta extension files user@machine:~$ ls -1 *.fasta | sort -n # View all .fasta extension files in increasing order
-
user@machine:~$ ls | grep '.fasta' # View all files that ends with .fasta extension user@machine:~$ ls | grep -E '\.fasta$' # View all files that ends with .fasta extension user@machine:~$ ls | grep -E '*\.fa$|*\.fasta$' # View all files that ends with both .fasta and .fa extension user@machine:~$ ls -1 | grep -E '*\.fasta$'| wc -l # Find all .fasta files from a location # -E, is for the regular expression.
-
user@machine:~$ find /home/mrz/Desktop/Bk/MakeDB -name '*.pssm' # View all files that ends with .fasta extension user@machine:~$ find /home/mrz/Desktop/Bk/MakeDB -type f -name 'pssm' # -type f, is for finding files user@machine:~$ find /home/mrz/Desktop/Bk/MakeDB -type d -name 'pssm' # -type d, is for finding directories user@machine:~$ find / -size 10M # Find file which is more than 10 MB
-
user@machine:~$ locate '*.pssm' # View all files that ends with .fasta extension user@machine:~$ locate -i '*.pssm' # -i, is for the case insensitive user@machine:~$ locate -S # Count the total number of directories, and files
user@machine:~$ df -h # Show disk's space usage
user@machine:~$ sudo fdisk -l # Whole Hard Disk Drive Information & Identifying the Partition Type
user@machine:~$ du -h --max-depth=1 /home/user # Show the directory space usage for the particular location.
user@machine:~$ du -h -s /home/user # -s, is for the summarizing the given location size.
user@machine:~$ du -h anyName.txt # Show file's space usage
user@machine:~$ du -h anyName # Show directory's space usage
-
user@machine:~$ sed 's/oldText/newText/' fileName.txt # Change the text segment without replacement) user@machine:~$ sed -i 's/oldText/newText/' fileName.txt # Change the text segment with replacement)
-
Step 2: Replace text segment (using tr)
user@machine:~$ cat fileName.txt | tr '!' '.' # tr must use as a pipeline
-
user@machine:~$ grep 'keyword' fileName.txt user@machine:~$ cat fileName.txt | grep 'keyword'
-
user@machine:~$ grep -r 'keyword' /home/user/Desktop ### It will search pattern from multiple directories. user@machine:~$ grep -r -i 'keyword' /home/user/Desktop ### It will search pattern from multiple directories; additionally, it ignore the case.
-
user@machine:~$ grep '>' fileName.fasta | wc -l # Number of lines denotes by ( l )
-
user@machine:~$ echo '[email protected]'| egrep '@gmail.com$' | egrep '^[a-zA-Z]' | sed 's/@gmail.com//' | tr '-d' '.' | egrep '[a-zA-Z0-9]{7,29}' user@machine:~$ echo '[email protected]'| egrep '@gmail.com$' | egrep '^[a-zA-Z]' | sed 's/@gmail.com//' | egrep '[a-zA-Z0-9.]{7,29}'
user@machine:~$ wget 'ftp://ftp.ncbi.nlm.nih.gov/blast/db/nr.*.tar.gz' # Download `nr` dataset from the NCBI website (FTP Server)
-
user@machine:~$ gzip anyName.fasta # anyName.fasta --> anyName.fasta.gz user@machine:~$ gunzip anyName.fasta.gz # anyName.fasta.gz --> anyName.fasta # gzip -d anyName.fasta.gz user@machine:~$ gzip *.fasta # *.fasta --> *.fasta.gz user@machine:~$ gunzip *.fasta.gz # *.fasta.gz --> *.fasta # gzip -d *.fasta.gz
-
user@machine:~$ bzip2 anyName.fasta # anyName.fasta --> anyName.fasta.bz2 user@machine:~$ bunzip2 anyName.fasta.bz2 # anyName.fasta.bz2 --> anyName.fasta # bzip2 -d anyName.fasta.bz2 user@machine:~$ bzip2 *.fasta # *.fasta --> *.fasta.bz2 user@machine:~$ bunzip2 *.fasta.bz2 # *.fasta.bz2 --> *.fasta # bzip2 -d *.fasta.bz2
-
user@machine:~$ zip -r anyName.zip anyName # anyName --> anyName.zip user@machine:~$ unzip anyName.zip # anyName.zip --> anyName
-
user@machine:~$ tar -cvf anyName.tar *.fasta # -c, is for create a .tar file user@machine:~$ gzip anyName.tar # Or, bzip2 anyName.tar
user@machine:~$ gunzip anyName.tar.gz # Or, bunzip2 anyName.tar.bz2 user@machine:~$ tar -xvf anyName.tar # -x, is for extract the *.tar file user@machine:~$ tar -xvzf anyName.tar.gz # Direct uncompress *.tar.gz file # Suggestion: Use graphical mode for the directory uncompression, if the directory is small-sized.
user@machine:~$ sudo apt install ./anyName.deb
-
rafsanjani@mrz:~$ conda clean --yes --all
-
rafsanjani@mrz:~$ rm -rf ~/.local/share/Trash/*
-
rafsanjani@mrz:~$ sudo apt autoremove && sudo apt autoclean
Note: The step doesn't mean you have to follow one by one.