How to create script for ls command for var folder
Hi,
I would like to seek for your assistance on my ongoing ls bash scripting. I need to create a script to get the content of my var folder. Please help me on this. Here is my current script: #!/bin/bash ls -lar /var Or please suggest any script that I could put on the server.. Really appreciate all your help. Thank you. |
Your current script works ok - display contents of /var. Please describe more exactly your problem.
|
Content for?
Your script is fine if all you want to know is what's in that directory. More insight as to what you're trying to accomplish will help us to help you. For example is this to be ran as a schedule job? Are you interested in files only, or directories, or both? ls will give you the basics to gather whatever is within the /var directory but if something more robust is needed, locate and find are better alternatives....example: this is a super simple example but will retrieve the contents
find /var | cut -c2- |
Quote:
Code:
alias lsv="ls /var/" Logput and back in, open a terminal and type Code:
lsv https://ryanstutorials.net/bash-scripting-tutorial/ Have Fun! |
Code:
stuff="$(echo -e ls /var | wc -w)" |
How to create script for ls command for var folder
actually grub works pretty smoothly i have found... but in my installing Slackware 9.1 I found that LILO isnt that hard to use if you just do it... I know have slackware and xp dualbooted and done it all by accident
|
Quote:
|
All times are GMT -5. The time now is 05:25 AM. |