Last active
February 26, 2018 09:14
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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