Linux Navigation and File Management Commands

This guide covers the basic understanding of exploration and navigation of linux system.

Find your current path”pwd”.
In order to find out current path, where your are standing.
Just run following command and it will return you the path.

pwd

It should return the following information, if you are standing in users root directory, where developer is the user name.
/home/developer
sdsds
How to get size of a folder?
du -hs <foldername or path>

How to get file(s) name contains certain string “grep”:
Let’s say you need to find file(s) from a folder those contains certian string. Grep will be the tool to solve your problem.
grep -H 'some string' *.csv

If you need to just find string in the file(s)
cat /folder/data.csv | grep 'findme'

You can also multiple grep at a time, take a look at how:
cat /folder/data.csv | grep 'findme' | grep 'findme2'

What will happen now, first grep will search data that contains string findme, the it will search findme2 outof first grep results.

Secure copy “scp”:
scp is a tool to upload or download a file from between local and remote machines.

Download a file from server:
scp user@remoteIP:/remotedirectory/backup/data.csv /home/user/download/

List environment variables “printenv”:
Following tools can be used to list environment veriables.

1. printenv Prints all or part of environment.
2. env Prints all exported environment or run a program in a modified environment.
3. set Prints the name and value of each shell variable.

Author: Danyal
I'm a skilled programmer specializing in Vue.js/Nuxt.js for front-end development and PHP Laravel for back-end solutions. I have a strong focus on API design and development, complemented by experience in web server setup and maintenance. My versatile expertise ensures seamless creation and maintenance of web applications, covering everything from intuitive user interfaces to robust server-side functionality. Passionate about coding and driven by a lifelong learning mindset, I invite you to explore more at danyal.dk.