Use this command to get a list of currently running processes. Along with the list you get process related information.
This would be returned for the current users processes whose effective user id (euid=EUID) is the same.
To get a more detailed output include the options “aux”, where a refers to all proccesses; u for user processes; x refers to system processes.
To change user or become superuser.
// Changes user to root su
You will be prompted
root user password to switch to user.
// Change user to another user su <user-name>
To change user back:
Use this command to download files via terminal.
For example, you can download a tar file, here
wget tar file:
Use this command to get a list of command that you had executed through terminal earlier.
To remove(clear) the history:
The above command will remove all commands from the history list.
To archive or extract a file or directory.
tar [option] <file-name> or tar [option] <directory-name>
To create a archive named “zip.tar” with a file “file.txt” in current directory.
tar -cvf zip.tar file.txt
To create a archive named “zip.tar” with all the files in the current directory, you can use:
tar -cvf zip.tar *
Extract a tar file
To extract a file named “zip.tar”, you can do the following:
tar -xvf zip.tar
This would extract all the files into the current directory.
To mount disk drives manully. (In ubuntu server automount doesnt happen, so if need to mount a drive you can use this command).
To check the drive properties use:
sudo fdisk -l
The above command will give you a list of drives. Find your drive’s name(1st column eg. “/dev/sda2”) and its device type(last column eg. “NTFS”).
Create the mount point:
Now you can mount the drive using mount point created above. Say, if you have a “NTFS” drive with drive name as
/dev/sda2, then to mount that drive you can do:
sudo mount -t ntfs /dev/sdb2 /media/<mount-point-name>
To unmount a mounted drive manually.
sudo unmount <device-name> or sudo unmount /media/<mount-point-name>