how to perform a system check on linux via terminal


 
Thread Tools Search this Thread
Operating Systems Linux how to perform a system check on linux via terminal
# 1  
Old 03-10-2011
how to perform a system check on linux via terminal

hi im new to this and i just want to learn about linux and i just wanted to know how would i be able to perform a system check to see if a directory exists.



can any one help me?
# 2  
Old 03-11-2011
In a shell: [ -d "/path/to/dir" ] && echo "Directory exists" or alternately [ -d "/path/to/dir" ] || echo "Directory doesn't exist"
# 3  
Old 03-12-2011
hey thanks a lot it worked Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Filter on one column and then perform conditional calculations on another column with a Linux script

Hi, I have a file (stats.txt) with columns like in the example below. Destination IP address, timestamp, TCP packet sequence number and packet length. destIP time seqNo packetLength 1.2.3.4 0.01 123 500 1.2.3.5 0.03 44 1500 1.3.2.5 0.08 44 1500 1.2.3.4 0.44... (12 Replies)
Discussion started by: Zooma
12 Replies

2. Red Hat

Menu system for terminal like Putty for host /ip list

Is there a way to create a menu in Gnome terminal to have a list of hosts with ip's like in Putty on Windows? (2 Replies)
Discussion started by: jlouki01
2 Replies

3. UNIX for Dummies Questions & Answers

How to check the system model in linux?

is there any way to check what model and made is the linux box from command line like - it is virtual server or is it a physical manchine then what made it is (4 Replies)
Discussion started by: robo
4 Replies

4. Shell Programming and Scripting

shell script to take input from a text file and perform check on each servers and copy files

HI all, I want to script where all the server names will be in a text file like server1 server2 server3 . and the script should take servernames from a text file and perform copy of files if the files are not present on those servers.after which it should take next servername till the end of... (0 Replies)
Discussion started by: joseph.dmello
0 Replies

5. OS X (Apple)

Editing System Preference in Terminal

Mac OS X 10.6: Leopard - I'm trying to create a script that will run on its own that can edit system preferences. I've done some digging, and found that a lot of system preference options are controlled by .plist files in ~/library/preferences, /library/preferences, and... (1 Reply)
Discussion started by: Jalaska13
1 Replies

6. UNIX for Advanced & Expert Users

Check EOF char in Unix. OR To check file has been received completely from a remote system

Advance Thanks. (1) I would like to know any unix/Linux command to check EOF char in a file. (2) Or Any way I can check a file has been reached completely at machine B from machine A. Note that machine A ftp/scp the file to machine B at unknown time. (5 Replies)
Discussion started by: alexalex1
5 Replies

7. Shell Programming and Scripting

perform a check based on number of @ in a log line

Hello, I am intending to perform a check based on number of "@" , present in a line in a log file . The idea is basically to perform a check on cc or bcc sender, based on an email log, which shows all the for email address. Say if the number of @ is more than 30, I will consider it as a mass... (12 Replies)
Discussion started by: fed.linuxgossip
12 Replies

8. UNIX for Dummies Questions & Answers

how to check the user input from terminal

Hello everybody!!! I am writing my own rm command in unix. I prompt the user to type if he wants to delete a file and then read what he typed. But how do i check what he typed? This is my program so far: echo 'Delete prog1.c (y/n)?' read yesOrNo if yesOrNo == 'y' then rm prog1.c... (6 Replies)
Discussion started by: mskart
6 Replies

9. Solaris

How to change the system prompt and BG of terminal?

Hi all, I was wondering how to change the PS1 to my liking? I tried changing it using PS1='my choice' it worked but the subsequent terminals i open will not have it as the default PS1 ,how do i change it? also i am running as super user, and i need to exec bash, to get the bash environment...... (4 Replies)
Discussion started by: wrapster
4 Replies

10. AIX

How to check who/which id perform a system reboot?

Hi Guys, I would like to know is there a way to find out who or which id performed the system reboot?Uptime only shows the last date the system was reboot but no userid or ip add.Need to investigate something due to some reboot issues. Thanks Giri (1 Reply)
Discussion started by: giriplug
1 Replies
Login or Register to Ask a Question