Feb.10

Linux Command mostly used in Software development [SSH]

Software Engineer have remembered some command which are mostly used for software development to make quick and easy manner if server system is Lenux based.

You have various choices for getting Secure Socket Shell SSH.

What is SSH?

SSH is widely used by network administrators for managing systems and applications remotely, allowing them to log in to another computer over a network, execute commands and move files from one computer to another.

You also get understand for navigate and work with files and database in SHH or Linux terminal.

 

ls Show directory contents (list the names of files).

Example:

you should list directory and file in this location.

prakash@pkbhandari.com [~]# ls

public_html  etc  tmp  logs

 

1: List Specified path files:

Example: ls <path/inner_path>

prakash@pkbhandari.com [~/public_html/sites/pk]# ls test_p
./  ../
prakash@pkbhandari.com [~/public_html/sites/pk]# ls pkb_files
./  ../  in_1/  new/  pkb_files/  pkb_files.txt  pk_zip.zip
prakash@pkbhandari.com [~/public_html/sites/pk]#

 

2. List all with hidden files:

Example: ls -a

3. List all with .dot files and hidden files:

Example: ls -all

 

4. See file and List all folder and files permission

@pkbhandari.com [~/public_html/sites/pk]# ls -lt
total 0
drwxr-xr-x  4 prakash group 54 Feb 10 13:13 ./
-rw-rw-r–  1 prakash group 0 Feb 10 13:13 pkb_file.txt
drwxrwxr-x  2 prakash group 6 Feb 10 12:55 test_p/
drwxr-xr-x  5 prakash group 80 Feb 10 12:31 pkb_files/
drwxr-xr-x. 6 prakash group 77 Feb 10 12:31 ../

folders : test_p,pkb_files

Files : pkb_file.txt

The bits we are interested in are drwxr-xr-x prakash and group

The d tells us that test is a directory. if without d it is file (pkb_file.txt).

The first three characters after the d are the owner permissions for the directory specified by the owner’s name.

  • r stands for read
  • w stands for write
  • x stands for execute (which in this case means you can access the folder)

 

Change Permission

To change the permissions for a file or folder you can use the chmod command. The chmod command lets you specify 3 numbers which set the permissions.
read permissions = 4
write permissions = 2
execute permissions = 1

To get a mixture of permissions you add the numbers together. For example to get read and execute permissions the number you need is 5, to get read and write permissions the number is 6 and to get write and execute permissions the number is 3.

Remember you need to specify 3 numbers as part of the chmod command. The first number is for the owner permissions, the second number is for the group permissions and the last number is for everyone else.

For example to get full permissions on the owner, read and execute permissions on the group and no permissions for anyone else type the following:

     chmod 750 test_p

 

 

cd Change Directory.

Example:

you should navigate the direction with folder name.

prakash@pkbhandari.com [~]# cd public_html

It will enter you in public_html folder.

 

mkdir Create a new folder (directory).

Syntax: mkdir <foldername>

Example:

prakash@pkbhandari.com [~/public_html/sites/pk]#mkdir pkb_test

it will create directory pkb_test in inside pk folder.

 

touch Create a new file.

 

rm Remove a file.
cat Show contents of a file.
pwd Show current directory (full path to where you are right now).
cp Copy file/folder.
mv Move file/folder.
grep Search for a specific phrase in file/lines.
find Search files and directories.
vi/nano Text editors.
history Show last 50 used commands.
clear Clear the terminal screen.
tar Create & Unpack compressed archives.
wget Download files from the internet.
du Get file size.
Share this Story:
  • facebook
  • twitter
  • gplus

Leave a comment

Facebook Comment