Linux commands 1 : Commonly used FILE AND DIRECTORY COMMANDS for daily use and interview

 

Hello Techies,

Unix Knowledge required for Software Testers - Manual and Automate the various UNIX / LINUX processes, So that we can achieve end to end test automation (If we have any Unix processes in your application).We use these command when we work on Git Bash too.

So here I am listing all the commands which we use frequently.

# List all files in a long listing (detailed) format
ls -al

# Display the present working directory
pwd

# Create a directory
mkdir directory

# Remove (delete) file
rm file

# Remove the directory and its contents recursively
rm -r directory

# Force removal of file without prompting for confirmation
rm -f file

# Forcefully remove directory recursively
rm -rf directory

# Copy file1 to file2
cp file1 file2

# Copy source_directory recursively to destination. If destination exists, copy source_directory into destination, otherwise create destination with the contents of source_directory.
cp -r source_directory destination

# Rename or move file1 to file2. If file2 is an existing directory, move file1 into directory file2
mv file1 file2

# Create symbolic link to linkname
ln -s /path/to/file linkname

# Create an empty file or update the access and modification times of file.
touch file

# View the contents of file
cat file

# Browse through a text file
less file

# Display the first 10 lines of file
head file

# Display the last 10 lines of file
tail file

# Display the last 10 lines of file and "follow" the file as it grows.
tail -f file
Note:All Linux commands are case sensitive.


Comments

Popular Posts

Most common used Docker Commands for SDETs

Running tests from maven command line: Different options