Skip to content

Instantly share code, notes, and snippets.

@Sylvance
Last active February 26, 2018 09:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Sylvance/29f0b010807fcf59fce00d4ec8e7b2d1 to your computer and use it in GitHub Desktop.
Save Sylvance/29f0b010807fcf59fce00d4ec8e7b2d1 to your computer and use it in GitHub Desktop.
A shell script that creates directories, moves to a different directories, copies files, lists directory contents, executes commands with parameters, pipes and redirects input #796
// make new directory to create directory
$ mkdir new_directory
// change directory to create directory
$ cd new_directory
// create a new file
$ touch cmd.txt
// create child_directory
$ mkdir child_directory
// move cmd.txt to child_directory
$ mv cmd.txt child_directory
// list files child_directory
$ cd child_directory
$ ls child_directory
// copy files
$ touch myfile
$ cp myfile newfile
$ cp myfile newfile2
// execute commands with parameters(list all)
$ ls -a
// pipes
$ touch tree.txt
$ ls -a > tree.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment