Sponsored Content
Top Forums Shell Programming and Scripting bash script to check USB in linux Post 302622751 by Corona688 on Thursday 12th of April 2012 02:25:20 PM
Old 04-12-2012
Since you have Linux, try:

Code:
fdisk -l /dev/disk/by-path/*usb* 2>/dev/null

 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

bash script to check the first character in string

Hello would appreciate if somebody can post a bash script that checks if the first character of the given string is equal to, say, "a" thnx in advance (2 Replies)
Discussion started by: ole111
2 Replies

2. Shell Programming and Scripting

bash script to check if mounted, and mount if not

I'd like to make a wrapper bash script that will make sure that an nfs mount is mounted before launching a program that depends on the mount being active. Basically: 1) Check to see if the mount is active 2) If it's not active, try to mount it 3) If it won't mount because the nfs server is... (3 Replies)
Discussion started by: graysky
3 Replies

3. Shell Programming and Scripting

BASH Script to Detect and List USB Flash Drives

Hello. This is my first post to this forum. I've read many of the posts over the last two or three years and I've learned a lot. I'm creating a live Linux distribution using the Linux Live Scripts -- just as a hobby project -- and I'm wanting to create an automated way for a user to copy the... (7 Replies)
Discussion started by: godzillarama
7 Replies

4. UNIX for Dummies Questions & Answers

USB-USB cable between linux and windows computers

Is there an easy way to setup a cross-over cable (USB-USB) between a linux box and a windows PC? My 2 machines are next to each other but I really do not want to keep transfering my files using my USB drive. Thanks! (4 Replies)
Discussion started by: Xterra
4 Replies

5. UNIX for Dummies Questions & Answers

Help Running a Check in Bash Script

Hey guys, so I wrote a small script that pretty much just takes in two numbers and counts from the first to the second, e.g. unknown-hacker|544> count.sh 1 3 1 2 3 My problem is I want to make it so that if you input invalid parameters, such as non-numerical characters, more than 2... (2 Replies)
Discussion started by: Duo11
2 Replies

6. Shell Programming and Scripting

bash script to check if a program is running

I'm a bit new to bash programming and I was assigned the job of writing a script that will check to see if a program server is running and to restart the program if it is not up. The script is supposed to check the program every hour (which I have looked up and I believe I know how to do) and send... (3 Replies)
Discussion started by: mcknz
3 Replies

7. Shell Programming and Scripting

Bash shell script to check if script itself is running

hi guys we've had nagios spewing false alarm (for the umpteenth time) and finally the customer had enough so they're starting to question nagios. we had the check interval increased from 5 minutes to 2 minutes, but that's just temporary solution. I'm thinking of implementing a script on the... (8 Replies)
Discussion started by: hedkandi
8 Replies

8. Shell Programming and Scripting

Bash Script to find/sort/move images/duplicate images from USB drive

Ultimately, I'm looking to create a script that allows me to plug in a usb drive with lots of jpegs on it & copy them over to a folder on my hard drive. So in the process of copying I am looking to hash check them, record dupes to a file, copy only 1 of the identical files (if it doesn't exsist... (1 Reply)
Discussion started by: JonaQuinn
1 Replies

9. Shell Programming and Scripting

Bash script for check files

I created this script for check whether specific files exist or not in the given location. but when I run this its always showing Failed - Flag_lms_device_info_20160628.txt do not exist Failed - Flag_lms_weekly_usage_info_20160628.txt do not exist but both files are existing. appreciate help... (2 Replies)
Discussion started by: lfreez
2 Replies
PVRESIZE(8)						      System Manager's Manual						       PVRESIZE(8)

NAME
pvresize - resize a disk or partition in use by LVM2 SYNOPSIS
pvresize [-d|--debug] [-h|--help] [-t|--test] [-v|--verbose] [--setphysicalvolumesizesize] PhysicalVolume [PhysicalVolume...] DESCRIPTION
pvresize resizes PhysicalVolume which may already be in a volume group and have active logical volumes allocated on it. OPTIONS
See lvm(8) for common options. --setphysicalvolumesize size Overrides the automatically-detected size of the PV. Use with care, or prior to reducing the physical size of the device. EXAMPLES
Expand the PV on /dev/sda1 after enlarging the partition with fdisk: pvresize /dev/sda1 Shrink the PV on /dev/sda1 prior to shrinking the partition with fdisk (ensure that the PV size is appropriate for your intended new parti- tion size): pvresize --setphysicalvolumesize 40G /dev/sda1 RESTRICTIONS
pvresize will refuse to shrink PhysicalVolume if it has allocated extents after where its new end would be. In the future, it should relo- cate these elsewhere in the volume group if there is sufficient free space, like pvmove does. pvresize won't currently work correctly on LVM1 volumes or PVs with extra metadata areas. SEE ALSO
lvm(8), pvmove(8), lvresize(8), fdisk(8) Sistina Software UK LVM TOOLS 2.02.44-cvs (02-17-09) PVRESIZE(8)
All times are GMT -4. The time now is 04:18 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy