You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

38 lines
1.7 KiB

title : Bash and terminal command
author: zvevqx
published: 2025-11-22
cat: linux
desc: ws
...
👾 MOST OF THIS PAGE IS DIRECT OUTPUT OF CHATGPT 3.5
# Basic Bash Commands for Navigating a File System
Here are some of the basic Bash commands you can use to navigate a file system:
1. `pwd`: Displays the current working directory.
2. `cd`: Changes the current working directory.
* `cd <directory-name>`: Changes to the specified directory.
* `cd ..`: Changes to the parent directory.
* `cd /`: Changes to the root directory.
* `cd ~`: Changes to the home directory.
3. `ls`: Lists the contents of the current directory.
* `ls <directory-name>`: Lists the contents of the specified directory.
* `ls -l`: Lists the contents of the current directory in long format.
* `ls -a`: Lists all contents of the current directory, including hidden files.
4. `mkdir`: Creates a new directory.
* `mkdir <directory-name>`: Creates a new directory with the specified name.
5. `touch`: Creates a new file.
* `touch <file-name>`: Creates a new file with the specified name.
6. `cp`: Copies a file or directory.
* `cp <source> <destination>`: Copies the file or directory from the source to the destination.
7. `mv`: Moves a file or directory.
* `mv <source> <destination>`: Moves the file or directory from the source to the destination.
8. `rm`: Deletes a file or directory.
* `rm <file-name>`: Deletes the specified file.
* `rm -r <directory-name>`: Deletes the specified directory and its contents.
These are just a few of the basic Bash commands you can use to navigate a file system. As you become more familiar with these commands, you can start to use more advanced commands to perform more complex tasks.