3
Q:

bash remove first character from line

# Example usage (3 options):
tail -n +43 input_file	# Print from the 43rd line on
sed 1,42d input_file	# Print from the 43rd line on
sed -i 1,42d input_file	# Remove the first 42 lines in place (meaning 
	# that the file is changed without having to print the output to a 
    # new file)
1
# Basic syntax:
cut -c n- input_file
# Where
#	- -c means "characters", as opposed to -f for "fields"
# 	- n is the number of characters to delete and n- means keep everything
#		past the nth character. (-n would mean keep everything up to the
#		nth character and just n means return the nth character)
1
sed 's/^.\{5\}//' logfile 
0

New to Communities?

Join the community