10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
In the below bash I am trying to ensure that all folders (represented by $folders) in a given directory are created. In the file f1 the trimmed folder will be there somewhere (will be multiple trimmed folders).
When that trimmed folder is found (represented by $S5) the the contents of $2 printed... (19 Replies)
Discussion started by: cmccabe
19 Replies
2. Shell Programming and Scripting
Hi,
I have a script doing backup to synology server, the script create new folder each day with the date as being folder name i.e. 2018-07-30. Just before creating the new folder I want the script to find the oldest folder from the list and delete it including its content.
for example... (3 Replies)
Discussion started by: humble_learner
3 Replies
3. Shell Programming and Scripting
In the bash below the oldest folder in a directory is selected. If there are 3folders in the directory /home/cmccabe/Desktop/NGS/test and nothing is done to them (ie. no files deleted, renamed) then the bash correctly identifies f1 as the oldest. However, if something is done to the folder then... (4 Replies)
Discussion started by: cmccabe
4 Replies
4. Shell Programming and Scripting
I am trying to create subdirectories in each folder in /home/cmccabe/Desktop/NGS/test/*. When I use echo I can see each folder in the directory, but I can not seem to add the commented out portion in bold. These are the sub-directories and sub-folders I am trying to add to each folder in... (1 Reply)
Discussion started by: cmccabe
1 Replies
5. Shell Programming and Scripting
I am trying to select a file in bash and save it to a directory. The below does run but no selected file is saved. Thank you :).
bash
# select file
printf "please select a file to analyze with entered gene or genes \n"
select file in $(cd... (4 Replies)
Discussion started by: cmccabe
4 Replies
6. Shell Programming and Scripting
I am using bash to prompt a user for a choice using: where a "y" response opens a menu with available panels that can be used.
while true; do
read -p "Do you want to get coverage of a specific panel?" yn
case $yn in
* ) menu; break;;
* ) exit;;
* ) echo... (6 Replies)
Discussion started by: cmccabe
6 Replies
7. UNIX and Linux Applications
I am trying to determine the oldest and most recent files in a huge directory. I am using an ls -tr statement outside my find statement. The directory is too big and I am getting an "arg list too long" error. Is there something I can put in my find statement that doesn't create a list to... (2 Replies)
Discussion started by: hiyofjord
2 Replies
8. Shell Programming and Scripting
Hi all,
I am a newbie to scripting and I need your help regarding finding the oldest file in a particular directory. My intention is to remove that oldest file.
Are there any options available with the "find" command to do this..
Thanks in advance for your help
Pavan (4 Replies)
Discussion started by: pavan_movva
4 Replies
9. Shell Programming and Scripting
Hi all,
I need your assistance in removing the oldest file in a directory.
I posted the same thread 3 days back and I got the following answer
ls -1 -t | tail -1 | xargs rm
which is not covering the case when there are directories older than the oldest file.
So, could you please... (2 Replies)
Discussion started by: pavan_movva
2 Replies
10. UNIX for Dummies Questions & Answers
I'm writing a script to find the oldest file in a directory. I know this can be done by using ls -rt | tail -1 but these are rather large directories and that can be somewhat slow since the script will be running constantly.
Are there any other ways to do this that would be faster? I looked to... (2 Replies)
Discussion started by: bergerj3
2 Replies