Terminal basics
The following commands provide a solid foundation for navigating and working within a Linux terminal environment, particularly in the context of AI-LAB. Familiarize yourself with these commands to enhance your productivity and efficiency when using the platform. You can also look at this basic course to the shell at: https://linuxjourney.com/lesson/the-shell.
Navigation Commands:
pwd
: Displays the current directory path.ls
: Shows the files and directories in the current location.cd [directory_name]
: Change to a directory within the current directory.cd /path/to/directory
: Change to an absolute directory path.cd ..
: Move up one directory level.cd ~
: Move to the home directory.cd -
: Return to the previous directory.
File Management Commands:
mkdir [directory_name]
: Create a directory with a specific name.rmdir [directory_name]
: Remove a directory.touch [file_name]
: Create a file with a specific name.cp [source] [destination]
: Copy a file or directory from the source to the destination.mv [source] [destination]
: Move a file or directory to a new location or rename it.rm [file_name]
: Remove a file.rm -r [directory_name]
: Remove a directory and its contents recursively.
Text Editing Commands:
nano [file_name]
: Open a file for editing.Ctrl + O
: Saving a File.Ctrl + X
: Exit Nano.
vim [file_name]
: Open a file for editing.:q
: Exit Vim.:wq
: Exit and save Vim.i
: Enter insert mode, where you can type to insert or edit text. Press Esc to exit insert mode.
Other Useful Commands:
cat [file_name]
: Display the contents of a file.grep [pattern] [file_name]
: Search for a specific pattern within a file.man [command_name]
: Access the manual pages for a specific command.history
: Display command history.