Beginner need help how file moving script could look like
Hi there,
I am an absolut beginner in scripting.
I am using Ubuntu Linux 18.04 LTS:
I just need some hints/suggestions how a script could look like doing the following stuff:
assuming I am in directory "base_directory"
like xyz@mypc:~/base_directory$
within the "base_directory there are some subfolders (random name) having subfolder (random name)
there is a structure like:
and so on....
each of the "sub-subfolders" contains several files
like ffe.txt, dwfekt.c etc.
now would like to grap e.g. all files with .c extension of every sub-subfolder and
move all files with .c extension to e.g. folder
is there an easy way to do so?
sorry for such a dump question but I am completely new in this and want to check
how much effort it takes to implement (maybe such simple) file operations.
Best Regards
dut
Moderator's Comments:
Please use CODE tags as required by forum rules!
Last edited by RudiC; 01-25-2019 at 03:54 PM..
Reason: Added CODE tags.
I would like to get a sample script (ksh or bash, or both so I could see the differences)
What I want to do with the script is send an daily email to myself that contains the following:
The number of files in a directory
The total size of the files in that directory
The contents of a file... (2 Replies)
#SD=source dir TD= target dir
SD="$/amddev/app01/manoj/new/scripts/old"
TD="$/amddev/app01/manoj/new/scripts/new"
EXT="$*.txt"
for i in `ls -F "$SD"/*"$EXT"|grep -v /$` do
mv "$SD" "$TD"
if
then
echo "$i" successfully moved
echo Manoj successfully..1 ( here i... (8 Replies)
Hi ,
I need a shell script which basicaly moves all the files from one folder say folder x to folder y and once they are moved to folder y a datetimestamp should be attached to there name
for ex
file a should be moved to y folder and renamed as a_20081015 (1 Reply)
hi
i am reading files from directory,if the files matches certain condition i need to move that file to another directory
i am using
if
then
mv $file1 > $UNIQDIR
fi
but i am gettin error , please help
thanks
Satya (4 Replies)
I am in an intro to unix/linux course, and need some help with a project. We are tasked with creating a basic script to automate a task that an Admin might need to do. We submitted ideas and mine was to have the system keep a record of log in and log out times for users. I thought this was going... (3 Replies)
Hi Experts,
I have a "Source" folder which may contain some files. I need a shell script which should move all files which are older than 3 days to "Archive" folder.
Thanks in Advance... (4 Replies)
I want to make a script that moves all files with a keyword on it to another folder. and lets me know how many files it moved with that keyword. Im a total newbie with scripting so a little help would be much appreciated. (3 Replies)
1. The problem statement, all variables and given/known data:
Arguments:
http://farm9.staticflickr.com/8070/8212131370_8b6e8c10c5_c.jpg
I am given these three arguments. $1, $2, $3
The first argument is the path to a directory.
So, how would I go into the directory and compare files?
I... (5 Replies)
Hi, so I have been doing ok making a relatively simple script just processing some data. However I am now at the point where im struggling to find the specific help I need.
I have files in the form of yyyy.ddd.hh.mm.ss.stationnumber.component (they are earthquake events). eg.... (12 Replies)
Dear All,
I am having a database that generates daily backup files in the below format.
abc_date_0010.zip.
Can you please suggest a method to copy the last day's file to another location.
I am trying with if statement, but having difficulty while I use the condition like
if ; then
... (4 Replies)
Discussion started by: skooby
4 Replies
LEARN ABOUT DEBIAN
ipfilter.conf
NETSCRIPT-2.2.conf(5) File Formats Manual NETSCRIPT-2.2.conf(5)NAME
/etc/netscript/network.conf - interface, firewalling, and QoS configuration file.
/etc/netscript/if.conf - interface setup shell script file
/etc/netscript/qos.conf - QoS setup shell script file
/etc/netscript/ipfilter.conf - IP chains filtering shell script file
/etc/netscript/srvfilter.conf - server IP filter shell script file
DESCRIPTION
This manpage is a place holder until something better is written when the netscript itself has stopped changing rapidly.
Please see the README file in the /etc/netscript directory, and READ the configuration files if you need to change them. Apart from net-
work.conf, all of them contain sh (1) shell script functions which are there so that various things can be altered or hooked in at the
right place. Network.conf contains the full network setup details, including special interface setup for the likes of ciped/pppd/wanconfig,
and is fully commented with examples given.
UPGRADE PATH FROM KERNEL 2.2.X
The firewall/IP filtering stuff in ipfilter.conf is the part that changed radically with the move to iptables and a far better way of set-
ting up the IP filtering rules, however the QoS and interface startup/shutdown in if.conf have changed but are backwards compatible with
the old 2.2.x ipchains version of netscript for the interface address configuration settings. You will have to set up the filtering again
to use iptables by directly using the iptables commands.
Also, the kernel 2.2.x version scripts are set up so that iptables is only run on a 2.4.x kernel, otherwise IP forwarding is disabled if
beforehand you set IPFWDING_KERNEL to FILTER_ON in network.conf.
This means that when you upgrade a box to a 2.4.x router kernel, you should then be able to reboot it and log into remotely and upgrade
netscript to the version that will support 2.4.x. In this situation, if you have set old IPFWDING_KERNEL setting to FILTER_ON beforehand
in network.conf, all IP forwarding through the box will also be disabled. This means that you can safely remotely upgrade a firewall.
SEE ALSO netscript(8), ipchains(8), iproute(8), brcfg(8).
AUTHOR
This manual page was written by Matthew Grant <grantma@anathoth.gen.nz>, for the Debian GNU/Linux system (but may be used by others).
BUGS
The author is lazy. He needs to write btter man pages...
November 23, 2000 NETSCRIPT-2.2.conf(5)