Linux Terminal Commands

Unzip a zip file

If the unzip command isn’t already installed on your system, then run:

sudo apt-get install unzip

After installing the unzip utility, if you want to extract to a particular destination folder, you can use:

unzip file.zip -d destination_folder

Download a File from internet

wget [File-URL]

Print working directory

pwd

Show files with hidden files

ls -a

Show Files with their file Size

ls -lh

Move files from one folder to another and Rename files 

mv /path_to_source_folder/filename /path_to_destination_folder/

See disk folder data usage

du -hs /path/to/directory

 

Copy directory from Server to Local Storage

scp -r root@139.59.79.32:/local/storage/directory /home/sumeet/mumbai

Copy directory from local storage to Server

scp -r /path/to/jar/filename.jar root@0.0.0.0:/nearbyshops

Copies files in directory of local server to remote server with ip and path on remote server

scp -r /path/to/my/files root@0.0.0.0:/path/on/remote/droplet

 

See a log

Just use the journalctl command, as in:

journalctl -u service-name.service

Or, to see only log messages for the current boot:

journalctl -u service-name.service -b

For things named <something>.service, you can actually just use <something>, as in:

journalctl -u service-name

 

SystemD

See full log using systemD

https://unix.stackexchange.com/questions/225401/how-to-see-full-log-from-systemctl-status-service

 

%d bloggers like this: