Creating multiple empty files with touch


 
Thread Tools Search this Thread
Top Forums UNIX for Beginners Questions & Answers Creating multiple empty files with touch
# 1  
Old 07-18-2016
Creating multiple empty files with touch

Hello, sorry to bother anyone reading this
I have an assignment with a question that reads:

Your current directory is stenton. Create empty files called f1, f2, and f12 (in that order), within stenton

So my first thought was to enter: touch f1 f2 f12
but that does not work, does anyone have ideas for similar commands?

thanks for your time
# 2  
Old 07-18-2016
Do not post classroom or homework problems in the main forums. Homework and coursework questions can only be posted in this forum under special homework rules.

Please review the rules, which you agreed to when you registered, if you have not already done so.

More-than-likely, posting homework in the main forums has resulted in a forum infraction. If you did not post homework, please explain the company you work for and the nature of the problem you are working on.

If you did post homework in the main forums, please review the guidelines for posting homework and repost.

Thank You.

The UNIX and Linux Forums.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Split file into multiple files based on empty lines

I am using below code to split files based on blank lines but it does not work. awk 'BEGIN{i=0}{RS="";}{x="F"++i;}{print > x;}' Your help would be highly appreciated find attachment of sample.txt file (2 Replies)
Discussion started by: imranrasheedamu
2 Replies

2. Shell Programming and Scripting

Using -text command and creating multiple files

Currently using the below script to being all compressed files .gz files from source folder and appending to the target txt file uncompressed. Teh target txt file is getting too large in size, right now the size of the target txt file is almost 350GB hadoop fs -text... (3 Replies)
Discussion started by: cplusplus1
3 Replies

3. Shell Programming and Scripting

Check file from multiple files is empty using awk

I am passing multiple files in awk & since one of the file is empty(say file3) so the same gets skipped & logic goes for toss. Need suggestion/help in checking and putting additional checks for the same awk -F, 'FNR==1 {++filecounter} filecounter==1 {KRL=$2;next} filecounter==2... (8 Replies)
Discussion started by: siramitsharma
8 Replies

4. Shell Programming and Scripting

Single command to create multiple empty files(no trailing lines as well).

Hi, i need a single command to create multiple empty files(no trailing lines as well) and empty the files if already existing. please let me know or if this has been ansered, if some ocan share the link please, thanks > newfile.txt or :> newfile.txt do not work (4 Replies)
Discussion started by: Onkar Banerjee
4 Replies

5. Shell Programming and Scripting

Empty out multiple files with a single command?

I have a log directory: /logs/foo.log /logs/bar.log /logs/err.out I'm trying to find a way to > /logs/*.log > /logs/*.out to blank them out, but of course, that doesn't work. Any suggestions? (4 Replies)
Discussion started by: Validatorian
4 Replies

6. Shell Programming and Scripting

Empty Multiple files contents

I would like to empty multiple files contents (without delete the file) which have similar name to begin with. e.g. log1.txt log2.txt log3.txt log4.txt I know cat /dev/null will do the job but that only apply to a single file. But when i tried cat /dev/null > {} \; that doesnt do... (7 Replies)
Discussion started by: kin
7 Replies

7. Shell Programming and Scripting

creating a multiple zip files

Hi, Please help me, i need a single line command for te below steps 1: listing a directory 2: searching a particular pattern in the names and creating the zip files of each eg : ls -lrt | grep jil | awk '{print $9}' output is kap.jil pranabjil pranabjil1 pranabjil2... (1 Reply)
Discussion started by: pranabrana
1 Replies

8. Homework & Coursework Questions

Creating empty files

Use and complete the template provided. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Write a single command to create a new empty file in P1 called cloud9, I have to do it from my current working directory which is P3 cd ../ away P1... (1 Reply)
Discussion started by: dat350z
1 Replies

9. UNIX for Dummies Questions & Answers

Touch all files and subdirectories (recursive touch)

I have a folder with many subdirectories and i need to set the modified date to today for everything in it. Please help, thanks! I tried something i found online, find . -print0 | xargs -r0 touch but I got the error: xargs: illegal option -- r (5 Replies)
Discussion started by: glev2005
5 Replies

10. Shell Programming and Scripting

How to empty file contents w/o rm and touch

Hi all, Can any one tell me how to empty the contents of a file in unix without using the following sequence : rm <file> ; touch <file> is there any command in unix?? is it possible through shell scripting? If so, how? -krishna (7 Replies)
Discussion started by: kris_kris
7 Replies
Login or Register to Ask a Question