Sponsored Content
Top Forums Shell Programming and Scripting Empty out multiple files with a single command? Post 302590549 by jlliagre on Monday 16th of January 2012 04:04:18 PM
Old 01-16-2012
Alternatively:
Code:
 for i in /logs/*.log /logs/*.out; do [[ -f $i ]] && > $i; done

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

how to rename multiple files with a single command

Hi I have following list of files at a path: 01.AR.asset 01.AR.index 01.AR.asset.vf 01.AR.asset.xv I want to rename all these files as follows: 73.AR.asset.Z 73.AR.index.Z 73.AR.asset.vf.Z 73.AR.asset.xv.Z Can any body give me a single command to acheive the above results. ... (5 Replies)
Discussion started by: tayyabq8
5 Replies

2. UNIX for Dummies Questions & Answers

How to run multiple command in single command?

Dear Unix Guru, I have several directories as below /home/user/ dir1 dir2 dir3 Each directory has different size. I want to print each directory size (Solaris command du -hs .) Can you please guide me how to achieve this? Thanks Bala (2 Replies)
Discussion started by: baluchen
2 Replies

3. UNIX for Dummies Questions & Answers

Grep multiple strings in multiple files using single command

Hi, I will use below command for grep single string ("osuser" is search string) ex: find . -type f | xarg grep -il osuser but i have one more string "v$session" here i want to grep in which file these two strings are present. any help is appreciated, Thanks in advance. Gagan (2 Replies)
Discussion started by: gagan4599
2 Replies

4. 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

5. 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

6. UNIX for Dummies Questions & Answers

Sftp multiple files in single command

Hi All, I would like to sftp 2 files with a single command. I tried the below options, sftp suer@test13:"/u01/home/oracle/SetDb.sh /u01/home/oracle/.profile" ./ But what actually happens is Fetching /u01/home/oracle/SetDb.sh to /u01/home/oracle/.profile /u01/home/oracle/SetDb.sh ... (3 Replies)
Discussion started by: sid2013
3 Replies

7. 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

8. 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

9. UNIX for Beginners Questions & Answers

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... (1 Reply)
Discussion started by: eleuin
1 Replies

10. Shell Programming and Scripting

Move multiple files to different directory using a single command

I have multiple files test1, test2, test3 etc. I want to move to a different directory with ABC_ prefixed to every file and and current dat time as postfix using a single command. (I will be using this is sftp with ! (command for local server). I have tried the following but it gives error ... (5 Replies)
Discussion started by: Soham
5 Replies
MUCOUS(1)							Museek Daemon Plus							 MUCOUS(1)

NAME
Mucous - Python / Curses client for museek SYNOPSIS
mucous [-c <filename>] [--config <filename>] [-l <directory>] [--log <directory>] [-v] [--version] [-h] [--help] DESCRIPTION
Mucous provides a interface for the Museek Daemon for chatting, transferring files, managing users and browsing shares on the Soulseek P2P network and Soulfind Servers. You will need a configured museekd(1). OPTIONS
Mucous accepts the following options: -c <filename>, --config <filename> Use a different config file. -l <directory>, --log <directory> Use a different chat log directory. -v, --version Display Version and exit. -h, --help Display Help and exit. EXAMPLE
To run this program the standard way type: mucous Alternativly you use a different config file with: mucous --config config Or a different chat logging directory with: mucous --log logdir ENVIRONMENTAL VARIABLES
TERM Specifies the type of Terminal; changes the way mucous displays color. For XTerm: xterm-color For aterm or rxvt: rxvt For urxvt: rxvt-unicode FILES
~/.mucous/config The default location for the mucous config file. ~/.mucous/logs/ The default directory for chat logs. ~/.mucous/logs/room/ The directory where chat room logs are stored. ~/.mucous/logs/private/ The directory where private chat logs are stored. ~/.mucous/$USER.image The file where a user's userinfo image is saved. AUTHORS
daelstorm <daelstorm@gmail.com> SEE ALSO
mulog(1) murmur(1) muscan(1) muscand(1) museekcontrol(1) museekd(1) museeq(1) musetup(1) musetup-gtk(1) daelstorm Release 0.8.0 MUCOUS(1)
All times are GMT -4. The time now is 04:46 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy