Mani Arumugam
29/04/2024
ls
— List directory contents.$ ls -lh
total 560K
-rw-r--r--. 1 ucdavis users 7.3K Feb 27 2020 adaptors_BGI.fasta
-rw-r--r--. 1 ucdavis users 1.7K Feb 27 2020 adaptors.fasta
-rw-r--r--. 1 ucdavis users 149 Jul 22 2020 adaptors_NovoGene.fasta
-rw-r--r--. 1 ucdavis users 12K Apr 23 11:23 linux-markdown.html
-rw-r--r--. 1 ucdavis users 3.9K Apr 23 11:23 linux-markdown.md
-rw-r--r--. 1 ucdavis users 12K Aug 31 2022 msb-pkgs.txt
-rw-r--r--. 1 ucdavis users 5.7K Mar 20 2023 pubmed2wikipedia.xsl
-rw-r--r--. 1 ucdavis users 179 Mar 17 2023 qhold.sbatch
drwxr-xr-x. 3 ucdavis users 45 Sep 13 2022 R
-rw-r--r--. 1 ucdavis users 591 Nov 1 2022 README.jupyter
$
cd
— Change directory.touch
— Create a new file.rm
— Remove files.cat
— Display file contents. Example:
cat file.txt
less
, more
— Scroll through text. Example:
less file.txt
head
, tail
— Show file start/end. Example:
head -n 5 file.txt
grep
— Search for text patterns. Example:
grep "sequence" file.txt
sort
— Sort file lines. Example:
sort names.txt
uniq
— Report or omit repeated lines. Example:
uniq names.txt
wc
— Print newline, word, and byte counts. Example:
wc file.txt
cut
— Remove sections from each line of files. Example:
cut -f1,3 -d',' data.csv
awk
— Pattern scanning and processing language.
Example: awk '{print $1}' file.txt
sed
— Stream editor for filtering and transforming
text. Example: sed 's/old/new/g' file.txt
chmod
— Modify file permissions. Example:
chmod u+rwx script.sh
chown
— Change file owner and group. Example:
chown user:group file.txt
top
— Display Linux processes. Example:
top
$ A=1
$ echo $A
1
$ my_text="hello world!"
$ echo $my_text
hello world!
$
scp
— Secure copy files over SSH.scp
to
receive filesscp user@server:/location/file local_file
scp
to
send filesscp local_file user@server:/location/file
>
symbol.>seq1
ATGCTAGCTAGCTACGATCGATCGATACGATC
AGCTAGCTAGCTGATCGATCGTAGCTAGCTAG
>seq2
GTCAGTCAGATCGATCGTAGCTAGCTACGATC
@
.+
(optionally followed by the same
sequence identifier and description).@seq1
ATGCTAGCTAGCTACGATCGATCGATACGATC
+
!''*((((***+))%%%++)(%%%%).1***-+*''))**55CCF>>>>>>CCCCCCC65