Question

How to copy all non hidden files in your current directory with names not beginning with...

How to copy all non hidden files in your current directory with names not beginning with a digit to other directory?

Homework Answers

Answer #1

Here we will use the cp command to copy all non-hidden files. and we will copy only those files which are not beginning with a digit and such file we will identify with the help of regex [^0-9]*  

In this regex  ^ symbol in regex is like a not. [^0-9] this indicates not any digit and * indicates all. so we are copying all files which are not starting with a digit by using the following command.

cp [^0-9]* path_of_dir/


path_of_dir is a path where you want to copy all these files.

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
What are the UNIX commands for each of these steps? 1. Copy all the files from...
What are the UNIX commands for each of these steps? 1. Copy all the files from the Files directory in my user account (user305) to your Files directory 2. Redirect echo step 11 to mark this step in the lab3.txt file 3. Display the directories and sub-directories including files so I can verify all the files were copied. 4. Redirect the above step to the lab3.txt file 5.. Copy only the following files from your Files directory to the Classes...
Write a short script filecount.sh that counts the total number of files in the current directory...
Write a short script filecount.sh that counts the total number of files in the current directory with names matching a specified pattern, and print out this number to screen. For example, bash filecount.sh *.txt should return the number of .txt files found in the current directory, while bash filecount.sh p*.txt should return the number of text files with names starting with p.
UNIX. Output the number of regular files in your current directory
UNIX. Output the number of regular files in your current directory
Using a PowerShell cmdlet (non-alias), pipe the contents of your current directory into a Where-Object search...
Using a PowerShell cmdlet (non-alias), pipe the contents of your current directory into a Where-Object search to find a file or group of files by partial or full filename. (Suggestion: Use part or all of a filename to filter everything else out of a directory listing. It’s much easier to test by looking for a file that really exists) POWERSHELL PLEASE!
Linuxzoo Tutorial 2 Question 6: cp Make the directory work your current directory and using an...
Linuxzoo Tutorial 2 Question 6: cp Make the directory work your current directory and using an absolute path name, copy the file 'bigfile2' in the tutorial directory to the scripts directory.
Add ssh-user to the super doers (root privilege) Copy Mac232 directory located in /root and all...
Add ssh-user to the super doers (root privilege) Copy Mac232 directory located in /root and all its contents to ssh-user home directory (Hint: use the option –R with cp command to recursively copy the directory’s contents) Logout then login as ssh-user - You will need to use the sudo command Change the ownership of MAC232 directory and all its contents to have the owner of “ssh-user” (Hint: use the option –R with chown command to recursively change the ownership of...
Write UNIX commands to perform the following tasks. Each task must use exactly one line of...
Write UNIX commands to perform the following tasks. Each task must use exactly one line of command. Unless stated otherwise, all files are assumed to be at your current working directory. a) (10 points) Print your current working directory into a file named file1 b) (10 points) Assume that your current working directory is NOT the same as your home directory. Print all file and subdirectory names of your home directory into a file named file2. c) (15 points) Copy...
You are to create a hard link to one of your existing files on someone else's...
You are to create a hard link to one of your existing files on someone else's directory (or vice versa). In other words, you know that you can link a file within your own directories, but you can also have a link to one of your files on other areas of the unix system as long as you have permissions to write to that directory (in this case, your partner). Create a subdirectory called temp where you can place this...
1. By convention, how are configuration files separated from regular files? (NOTE: A practical effect of...
1. By convention, how are configuration files separated from regular files? (NOTE: A practical effect of the separation is that they are not displayed by the default version of the ls command)                         a. the prefix "rc" (rc.filename)               c. the extension .cfig                         b. a dot (.) at the beginning                    d. by having the SUID bit set 2. The IP address which is reserved for local loopback (equivalent to "localhost") is:                         a. 255.255.255.0                                   c. 192.168.70.1...
Lab of operating system: please use the linux server please so all the commands used and...
Lab of operating system: please use the linux server please so all the commands used and the output PROBLEM 1: Create a file and name it f1 • Cerate a directory and name it d1 • Move f1 to d1 • Create a directory and name it d2 • Move d1 to d2 • Check if d1 is inside d2 • Check if f1 is inside d1 • While your (Current Working Directory) CWD is d1, move back f1 to...