Arraygen Linux Manual
Arraygen Linux Manual
What is linux ?
Just like Windows XP, Windows 7, Windows 8, and Mac OS X, inux is a free, open-source
operating system. An operating system is software that manages all of the hardware
resources associated with your desktop or laptop. To put it simply – the operating system
manages the communication between your software and your hardware. Without the
operating system (often referred to as the “OS”), the software wouldn’t function.
Linux commands :
Linux filesystems are based on a directory tree. This means that you can create
directories (or "folders") inside other directories, and files can exist in any directory.
To see what directory you are currently active in:
pwd
This stands for "print working directory", and will print the path to your current
directory. The output can look similar to this:
/home/arraygen
whoami
uname
--operating system.
To see other files and directories that exist in your current working directory:
ls (list) command is used.
To get a long listing of files which contains all the details such as file size,
permissions,
Time stamp, user details sorted by the modification time, use ls -l as follows.
ls -l : to list contents in long format i.e. with owner, permissions etc.
ls -a : to see all hidden files.
ls dir : list all items in directory dir.
ls *.fasta ->display the name of all fasta files in the given folder.
With the man command, you can retrieve the information in the manual and display it as
text output on your screen.
man : for getting help for command.
For eg. man ls
Creating Directories :
Removing Directories:
rmdir : delete directory
rmdir dirname
Changing Directories:
cd : go in directory anytime.
For eg. cd ArrayGen
Renaming Directories:
mv old_file new_file
Creating file:
rm : remove file
rm file_name
You can remove multiple files at a tile as follows:
rm filename1 filename2 filename3
Download .fasta file from NCBI nucleotide database and .fastq file from NCBI
SRA database. Save it in the directory.
cat stands for "catenate." It reads data from files, and outputs
their contents. It is the simplest way to display the contents of a file at
the command line.
cat is one of the most commonly-used commands in Linux. It can be used to:
Display text files
cat sequence.fasta
Copy text files into a new document
cat mytext.txt > newfile.txt
Similarly, you can catenate several files into your destination file.
For eg. cat mytext.txt mytext2.txt > newfile.txt
Append the contents of a text file to the end of another text file.
Instead of overwriting another file, you can also append a source text file to another
using the redirection operator ">>".
cat mytext.txt >> another-text-file.txt
This works for multiple text files as well:
wc -l : line count
wc -w: word count
wc -m : character count
wc -c : byte count
wc -L : length of the longest line
For eg. wc -l sequence.fasta
OR
OR
grep command:
Match regular expression in files. Use grep function for matching pattern.
--It will print the header of test.fasta file which starts with > sign.
Compression of file :
Two most common tools for compressing files gzip and bzip2.
gzip sra_data.fastq
--The extension of output file would be .gz after compressing.
bzip2 sra_data.fastq
--The extension of output file would be .bz2 after compressing.
Uncompression of file :
Two most common tools for uncompressing files gunzip and bunzip2.
For eg.
gunzip sra_data.fastq
OR
tar -jcvf outfile.fastq.tbz2 sra_data.fastq
x : extract
j : deal with bzipped file
f : read from a file
z : tells tar to uncompress the archive using gzip
To search packages :
sudo aptitude search packagename
--this will search pakages
apt-cache search . : to search all packages install in your system.
sudo is used to earn root access and be able to install and remove software. sudo
is always required if you do system wide changes like installing, removing, updating
and upgrading packages.
apt-get
The above command used to manage any software and software sources. Install is an
extra command that tells the computer that you want to install software with the package
name as follows. It will then check the software sources for a download link with the same
name and then download and install the latest version (or specified version).
sudo aptitude
The aptitude package is a GUI version of the apt-get command, it hasn't got the full set of
features as apt-get but you have the basics like, remove, update, upgrade, install, etc.
https://pypi.python.org/pypi/cutadapt
● The following command is use to provide permmission to read, write and execute.
sudo chmod -R 777 path of extracted folder
The above command will open bash.bashrc file. At the end of file please type following line
and save it.
If java is not installed then first install java using following command-
sudo apt-get install default-jre
wget :
wget stands for "web get". It is a command-line utility which downloads files over a
network.
If your operating system is Ubuntu, or another Debian-based
Linux distribution which uses APT for package management, you
can install wget with apt-get:
Installing wget :
sudo apt-get install wget
Syntax :
wget [option]... [URL]...
eg: Download R studio
wget https://download1.rstudio.org/rstudio-0.99.902-amd64.deb
Shortcuts :
ctrl+a :move cursor to beginning of line
ctrl+f : move cursor to end of line
alt+f : move cursor forward 1 word
alt+b : move cursor backward 1 word
ctrl+c : halts the current command
ctrl+z : stops the current command
ctrl+d : logout the current session, similar to exit
ctrl+l : clear screen