NO DATA NO Machine Learning Chapter -6 Linux Commands
The story of data
LINUX Commands
Return your user name:
whoamiReturn your user and group id:
idReturn operating system name, username, and other info:
uname -aDisplay reference manual for a command:
man topList available man pages, including a brief description for each command:
man -k .Get help on any command (for eg: curl):
curl --helpReturn the current date and time:
dateNavigating and working with directories
List files and directories by date, newest to last:
ls -lrtFind files in directory tree that end in .sh:
find -name \'\*.sh\'Return path to present working directory:
pwdMake a new directory:
mkdir new_folderChange the current directory:
Get Krushna Thakkar’s stories in your inbox
Join Medium for free to get updates from this writer.
Up one level:
cd ../To home:
cd ~` or `cdTo some other directory: cd path_to_directory:
rmdir temp_directory -vMonitoring system performance and status
List selection of/all running processes and their PIDs:
ps
ps -eDisplay resource usage:
topList mounted file systems and usage:
dfCreating, copying, moving, and deleting files:
Create an empty file or update existing file’s timestamp:
touch a_new_file.txtCopy a file:
cp file.txt new_path/new_name.txtChange file name or path:
mv this_file.txt that_path/that_file.txtRemove a file verbosely:
rm this_old_file.txt -vWorking with file permissions
Change/modify file permissions to ‘execute’ for all users:
chmod +x my_script.shChange/modify file permissions to ‘execute’ only for you, the current user:
chmod u+x my_file.txtRemove ‘read’ permissions from group and other users:
chmod go-rDisplaying file and string contents
Display file contents:
cat my_shell_script.shDisplay file contents page-by-page:
more ReadMe.txtDisplay first 10 lines of file:
head -10 data_table.csvDisplay last 10 lines of file:
tail -10 data_table.csvDisplay string or variable value:
echo "I am not a robot"
echo "I am $USERNAME"Basic text wrangling
Sorting lines and dropping duplicates:
Sort and display lines of file alphanumerically:
sort text_file.txtIn reverse order:
sort -r text_file.txtDrop consecutive duplicated lines and display result:
uniq list_with_duplicated_lines.txtDisplaying basic stats:
Display the count of lines, words, or characters in a file:
Lines:
wc -l table_of_data.csvwords:
wc -w my_essay.txCharacters:
wc -m some_document.txt







