From 4739998a4bbefd2a83c0daada474b8758ba3cb36 Mon Sep 17 00:00:00 2001 From: nywgithub <40202140+nywgithub@users.noreply.github.com> Date: Tue, 12 Jun 2018 22:09:51 +0800 Subject: [PATCH] =?UTF-8?q?Create=20160804117=20=E5=80=AA=E6=B0=B8?= =?UTF-8?q?=E7=82=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...4117 \345\200\252\346\260\270\347\202\234" | 65 +++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 "160804117 \345\200\252\346\260\270\347\202\234" diff --git "a/160804117 \345\200\252\346\260\270\347\202\234" "b/160804117 \345\200\252\346\260\270\347\202\234" new file mode 100644 index 0000000..7c3b7b1 --- /dev/null +++ "b/160804117 \345\200\252\346\260\270\347\202\234" @@ -0,0 +1,65 @@ +exercise1 +@@ -0,0 +1,12 @@ ++# 1.Create a file called message.txt in your home directory and move it into another directory. ++ ++touch /home/message.txt ++mv /home/message.txt distination ++ ++# 2.Copy the message.txt you just moved into your home directory. ++ ++cp message.txt /home/message.txt ++ ++# 3.Delete both copies of message.txt. Try to do this without using rm. ++ ++unlink message.txt && unlink /home/message.txt + +exercise2 +@@ -0,0 +1,20 @@ ++# Create a new directory called workbench in your home directory. ++mkdir /home/workbench ++ ++# Without changing directories create a file called readme.txt inside of workbench. ++vim /home/workbench/readme.txt ++esc + :wq ++ ++# Append the numbers 1, 2, and 3 to readme.txt so that each number appears on it’s own line. ++echo -e "1\n2\n3" > /home/workbench/readme.txt ++ ++# Print readme.txt to the command line. ++cat -n readme.txt ++ ++# Use output redirection to create a new file in the workbench directory called list.txt which lists the files and folders in your home directory. ++touch workbench/list.txt ++ls /home > /home/workbench/list.txt ++ ++# Find out how many characters are in list.txt without opening the file or printing it to the command line. ++wc -m /home/workbench/list.txt ++ + +exercise3 +@@ -0,0 +1,11 @@ ++# Before I organized the photos by year, what command would have listed all of the photos of type .png? ++find . -name "*.png" ++ ++# Before I organized the photos by year, what command would have deleted all of my hiking photos? ++find . -name "*hiking*" ++ ++# What series of commands would you use in order to put my figures for a data science course and the pictures I took in the lab into their own folders ++ ++# Supposed that we have a file including all pngs and txts, we are going to move them seperately. ++mv *.txt data ++mv *.jpg photo + +exercise4 +@@ -0,0 +1,11 @@ ++# Before I organized the photos by year, what command would have listed all of the photos of type .png? ++find . -name "*.png" ++ ++# Before I organized the photos by year, what command would have deleted all of my hiking photos? ++find . -name "*hiking*" ++ ++# What series of commands would you use in order to put my figures for a data science course and the pictures I took in the lab into their own folders ++ ++# Supposed that we have a file including all pngs and txts, we are going to move them seperately. ++mv *.txt data ++mv *.jpg photo