Linux Commands for your VPS Cloud Server

Introduction

Linux Commands is a program that takes commands from the keyboard and gives them to the operating system to perform.

This tutorial explains some of the most used Linux commands and their basic usage. All these commands should be entered at the command prompt and you must press the ENTER button to execute the desired command.

To open your command prompt, just press Ctrl + Alt + T or you can search for it by pressing “Windows” key and typing “terminal”.

Please note that all Linux commands are case sensitive (so upper- or lower-case letters matter).


10 Linux commands

1. cat – Shows the contents of files to the screen.

Usage:

# cat file.txt
# Hello World

Also this command can be used to count the number of lines, words and characters in a file:

cat  | wc -l

– number of lines

cat  | wc -w

– number of words

cat  | wc -c

– number of characters

To search for a word in a file you can use:

# cat  | grep 

2. cd – Change directory

the ‘cd’ command should be used followed by the name of a directory including the full path to that directory. If you execute ‘cd’ without arguments the working directory will be switched to your ‘home directory’.

cat

Usage:

# cd /path/to/directory_name/

To move one directory up, you can use the shortcut command:

# cd ..

3. cp – Copy files and directories

Usage:

# cp  

Example:

# cp /root/file /tmp/

With this command you will make a copy of ‘file’ located in the ‘/root’ directory to the ‘/tmp’ directory if it does not exist. It will overwrite it in case the ‘file’ already exists.

4. df – Check the amount of free disk space on the file systems.

Usage:

# df

To get a more easily readable (human-readable) output of the command use:

# df -h

5. free – Gives info on used and free memory and swap space.

Usage:

# free

The -b option shows the amount of memory in bytes; the -k option (set by default) shows it in kilobytes; the -m options shows it in megabytes.

6. rm – Removes directories, files, symbolic links, etc. from the filesystem.

Usage:

# rm  

Most common options for this command are:

-f : ignore nonexistent files, never prompt
-r : remove directories and their contents recursively
-v : explain what is being removed

Note: Always double check before removing any file or directory.

7. ls – Displays a list of files and directories in a specific directory.

If you enter just ‘ls’ without specifying a directory, it will display a list of files and directories in the working directory.

Usage:

# ls

Most common options for this command are:

-a : shows all files and folders including the hidden ones.
-l : use a long listing format

8. mv – Moves and renames files and directories.

Usage:

Move ‘file’ from ‘/root’ to ‘/tmp’ directory

# mv /root/file /tmp/

Rename ‘file1’ to ‘file2’

# mv file1 file2

9. passwd – change user password

Usage:

# passwd 

If you execute just ‘passwd’ without specifying the username, you will change your root password.

10. mkdir – Creates new directory(ies)

Usage:

# mkdir 

Example:

# mkdir /var/www/

Now that you’ve read the 10 Linux commands for beginners, you should be ready to login and try for yourself. If you do not have a BIP media server, click here to see the great packages they have to offer.



Tags: , , , , , , , , , , , ,

Spin up a cloud server in no time flat

Simple setup. Full root access. Straightforward pricing.


DEPLOY SERVER




Leave a Reply