User Tools

Site Tools

tools:bash:getting-started

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
tools:bash:getting-started [2024/05/20 03:48] โ€“ [Filesystem Traversal] Humphrey Boa-Garttools:bash:getting-started [2024/08/06 05:54] (current) โ€“ external edit 127.0.0.1
Line 82: Line 82:
  
   $ su username   $ su username
 +  
 +Open new remote shell for user //username@host// as child of current shell (see [[tools:ssh|SSH]] for more info):
 +
 +  $ ssh username@host
  
-You can use ''who am i'' to see who you are logged in as. You can bring up more identity info with the commands ''id'' and ''who -uh''.+You can use ''who am i'' to see who you are logged in as. You can bring up more identity info with the commands ''id'' and ''who -uH''.
  
 ===== Filesystem Traversal ===== ===== Filesystem Traversal =====
  
-Show present working directory (pwd):+Echo your shell's [[wp>Working directory|present working directory]] (pwd):
  
   $ pwd   $ pwd
  
-Show file tree for //path//:+Show file tree for the directory //path//:
  
   $ tree path/   $ tree path/
Line 103: Line 107:
   $ ls   $ ls
  
-Display directory listing. Some options include:+Outputs a list of contents of the pwd. Some options include:
  
   * ''-F'' (With folders identified)   * ''-F'' (With folders identified)
Line 114: Line 118:
   * ''-R'' (Recursive into subdirectories)   * ''-R'' (Recursive into subdirectories)
   * ''-i'' (Show inode number)   * ''-i'' (Show inode number)
 +
 +To show the contents of the directory //foldername//, in a human-readable long listing format with folders and hidden dotfiles identified, you would use:
 +
 +  $ ls -lhAF foldername/
 +==== cd ====
 +
 +Move your shell to a new working directory:
 +
 +  $ cd path/to/new/directory/
 +  
 +Move your shell up one level to the parent directory of your pwd:
 +
 +  $ cd ../
 +  
 +Move your shell to your home directory:
 +
 +  $ cd ~/
  
 ===== Viewing Contents of Files ===== ===== Viewing Contents of Files =====
Line 206: Line 227:
   $ grep searchterm path/   $ grep searchterm path/
  
 +For more information, see [[tools:grep|grep]].
 ===== Basic File and Directory Commands ===== ===== Basic File and Directory Commands =====
  
Line 261: Line 283:
 This command normally creates [[wp>Hard link|hard links]] by default. The ''-s'' flag directs ''ln'' to create a symlink instead of hard link. In 9/10 cases, you will probably only need to use symlinks. This command normally creates [[wp>Hard link|hard links]] by default. The ''-s'' flag directs ''ln'' to create a symlink instead of hard link. In 9/10 cases, you will probably only need to use symlinks.
  
-To use ''ln'' to add, say, an executable [[tools:appimage|AppImage]] to your account's personal /bin/ directory, and assign it a new shorthand name, you would run something like this:+To use ''ln'' to add, say, a symlink for an executable [[tools:appimage|AppImage]] to your account's personal /bin/ directory, and assign it a new shorthand name, you would run something like this:
  
   $ ln -s path/to/the.appimage ~/.local/bin/newname   $ ln -s path/to/the.appimage ~/.local/bin/newname
Line 289: Line 311:
   $ rm ./*   $ rm ./*
      
-Delete all files within directory /foldername/:+Delete all files within directory //foldername//:
  
   $ rm foldername/*   $ rm foldername/*
Line 302: Line 324:
  
 ''rmdir'' will not delete a folder with contents. Use ''rm -rf foldername/'' to have **rm** to recursively delete the folder and its contents instead. ''rmdir'' will not delete a folder with contents. Use ''rm -rf foldername/'' to have **rm** to recursively delete the folder and its contents instead.
 +
 +----
 +
 +  * Next Page: [[tools:bash:shortcuts piping|Shortcuts & Piping Commands โ†’]]
 +  * [[tools:bash|Back to Index]]
tools/bash/getting-started.1716176896.txt.gz ยท Last modified: (external edit)

Find this page online at: https://bestpoint.institute/tools/bash/getting-started